[Top][All Lists]

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

face for selection

From: Per Bothner
Subject: face for selection
Date: Thu, 10 Sep 2020 08:32:01 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

I took at look at bash-5.1/readline-8.1 and I couldn't find much information
about the "faces" feature and how it works with the region.

One question/possibility that occurred to me: Would it be possible to bind
the region to the system (primary) selection, the way Emacs does it?
Perhaps a setting so bash can emit an escape sequence to indicate the
start of the region, and another sequence to indicate the end?
Then a terminal emulator could use those escape sequence to indicate that
the region is the selection, and it would highlight it in whatever
manner to normally highlights the selection.  The terminal menu's Edit/Copy
would be able to use that bash region, as would its appropriate escape sequence
(commonly Ctrl-Shift-C).  Middle-click-paste would paste the region.

(I'd be happy to implement the needed support in DomTerm https://domterm.org )

The "opposite" feature is when the user selections a region with the mouse,
the terminal emulator can send appropriate escape sequences so bash
can set the region appropriately.  (In this case you'd want bash to use
use the system selection highlighting for the region so the bash highlighting
doesn't conflict with the terminal's selection highlighting.)  I don't know
how difficult that would be, but probably easy assuming suitable readline 
could be used to set/unset the mark, and if the terminal knows how to move
the position on a mouse click (see below).

(The above set-region-from-mouse-selection feature works best if you can also 
the position with a mouse click.  This works in DomTerm, in the appropriate 
on a mouse click DomTerm sends the needed arrow-key sequences to move the 
position to match.  The iTerm2 terminal supports a similar feature, but only 
you also press the Option key.)
        --Per Bothner
per@bothner.com   http://per.bothner.com/

reply via email to

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