2/4/22 11:21, Chet Ramey wrote:
On 2/3/22 4:09 PM, Per Bothner wrote:
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.

Then you can essentially do that now, using $PROMPT_COMMAND and $PS0.

That might work but could be a bit fragile.  You'd want high-lighting
to be reset to normal mode whenever readline exits (error or normal),
not just before a command starts executing.

I just don't see any particular advantage to doing it.

The goal is to find a way to show that pasting has occurred
(and readline is awaiting more editing or an Enter)
without the disconcerting and ugly inverse video currently used.
If we have some way to highlight the input editing area,
I think that is a more elegant approach.

Alternatively, we can use some highlight mode for the *rest* of the input lines.
(I.e. the current input line(s) *except* prompt and editing area.)
The latter approach as the advantage that the default can be a neutral color
that works for both dark mode and light mode.

Either way, if the cursor is in a line with such highlighting,
it makes it clear readline is waiting for input.  Also, I think highlighting
input lines in a style distinct from output is useful in itself.
--
        --Per Bothner
[email protected]   http://per.bothner.com/

Reply via email to