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: Thu, 3 Feb 2022 13:09:48 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0



On 2/3/22 12:36, Chet Ramey wrote:
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.

What's the `active input area'? A series of characters bound to self-
insert? And what delimits it? A character bound to an editing command?

By "active input area" I mean the text in the terminal that can be edited:
what gets sent to the application on Enter.  More precisely, the section
of the visible terminal corresponding to that text.  The area after the prompt,
and up to the last entered (or pasted) character.

Whether the blank area between the last character and the right margin
should also be part of the highlighted areas can be discussed.  DomTerm
uses a darker yellow for this "blank area" and a slightly stronger yellow
for the actual text (including explicitly-typed spaces).  You can this in
the second screenshot at: https://domterm.org/Features.html
Note the lighter yellow space after 'sh tests/grapheme-widths.sh' - that
is because Bash added a space after tab-completion, so that space became part
of the "active input area". (DomTerm currently uses the same style
for the current input line and previous input lines, except in "line mode"
where it adds pale dages around the current input line(s).)

A simple design might be two variables input-area-start-style
and input-area-end-style, which are escape sequences that take 0 columns.
Readline emits input-area-start-style after it has written the prompt,
and writes input-area-end-style on Enter or when it needs to redisplay the 
prompt.
--
        --Per Bothner
per@bothner.com   http://per.bothner.com/



reply via email to

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