I can feel it is a little sluggish. Also, it is buggy in some cases (I
don't know what causes it, maybe the ANSI control sequences are not
handled correctly) so that it is not highlighted but just pasting some
ANSI control sequences.
The text length is not calculated correctly. For example, it may cause
the move-on to the next line when it is should not be (I guess it is
because the control sequence is accounted toward the length of the
copied text, but the length of the text shown is not the same).
Should this feature be turned off by default?
On 2/2/21, Chet Ramey <chet.ramey@case.edu> wrote:
On 2/2/21 11:01 PM, Lawrence Velázquez wrote:
On Feb 2, 2021, at 10:22 PM, Peng Yu <pengyu.ut@gmail.com> wrote:
I notice that I have to add `set enable-bracketed-paste off` into my
~/.inputrc to disable adding ansi color code when copying text. But I
don't remember this feature in earlier version of bash. At which
version of bash was this feature introduced? Thanks.
Bracketed paste support was added in readline 7.0 (bash 4.4) [1]
and became enabled by default in readline 8.1 (bash 5.1) [2].
This is correct. The other change, to add the active region code that does
the actual highlighting, is from a patch back in March, 2018:
https://lists.gnu.org/archive/html/bug-bash/2018-03/msg00056.html
that I finally added in March, 2020:
https://lists.gnu.org/archive/html/bug-bash/2020-03/msg00064.html
and appeared in bash-5.1/readline-8.1.
The reason for the active region patch is to highlight the text inserted
by bracketed-paste.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/