bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bracketed-paste-mode should default to "off"


From: Per Bothner
Subject: Re: bracketed-paste-mode should default to "off"
Date: Tue, 1 Feb 2022 17:07:11 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0



On 2/1/22 15:59, Karl O. Pinc wrote:
With bracketed paste on, when pasting anything containing a newline,
it is as if there's a "Press enter to continue" invisible dialog that
pops up.  There is no way to tell that your terminal is waiting
for you to do something.

Actually, in the bash-with-readline I'm currently using bracketed paste will 
highlight
the pasted text with inverse video.  I have mixed feelings about this.

An alternative idea: A user-settable highlight style for the *entire*
active input area - pasted text as well  a directy-typed characters.
Even better: Two user-selectable styles, one for the current active input area,
and one for previous input areas.  (Once you type Enter, the highlight style
of the input area is changed from the current-input to previous-input style.)

I've implemented support for something like this in my DomTerm
terminal emulator, and I think it is pretty nice.

I agree it would be nice to make things safer by default
but I don't really see that happening here.  I'd like to
see such a substantive change justified.  What is the
threat model?  Maybe I've not got the proper perspective
because I think about/use the features of readline primarily
at the terminal prompt.  Is a beginner, who's the target of
malware or phishing, really going to edit something they've
pasted after pasting it before execution?  Is the extra
step really going to allow to removal of the malice?  I don't
see such a user, who's already decided to cut-and-paste
from some email (or more typically, some random website),
pausing after pasting and then deciding
to research and correct whatever flaw in the pasted text
the attacker has placed there.

It's not just an issue of malice.  Suppose you copy and paste
some commands from a tutorial, and you accidentally copy an extra line.
Or you intend to copy a line and then edit it before execution,
but you accidentally include the final newline.  Having to type
an extra Enter is a small price to reduce the risk of such accidents.
--
        --Per Bothner
per@bothner.com   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]