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 keybindings 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 move the position with a mouse click. This works in DomTerm, in the appropriate mode: on a mouse click DomTerm sends the needed arrow-key sequences to move the readline position to match. The iTerm2 terminal supports a similar feature, but only when you also press the Option key.) -- --Per Bothner p...@bothner.com http://per.bothner.com/