#972344 bash automatically selects the copied text

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Antonio
Date:
2021-01-14 13:09:03 UTC
Severity:
normal
#972344#5
Date:
2020-10-16 15:07:57 UTC
From:
To:
Dear Maintainer,
after updating bash to version 5.1 ~ rc1-2 I noticed a new behavior: when
you paste a text it is automatically selected.
This however creates confusion as on plasma / konsole as the text is
confused with the cursor (block), placed at the end of the word.
How can I disable this new feature?
Thank you,
Antonio De Lorenzi

#972344#10
Date:
2020-10-19 17:48:00 UTC
From:
To:
please could you forward that issue upstream, using the bashbug script?

Thanks, Matthias

#972344#15
Date:
2020-11-02 14:50:57 UTC
From:
To:
Hi,

This seems to be related to this bash changelog entry:

f. New active mark and face feature: when enabled, it will highlight the text
   inserted by a bracketed paste (the `active region') and the text found by
   incremental and non-incremental history searches.

There's also this in CWRU/changes that seems related:

- rl_activate_mark,rl_deactivate_mark,rl_mark_is_active_p,
  rl_keep_mark_active: new functions to manage an active region. We
  don't do anything with an active region yet. Part of a large patch
  for active regions from Daniel Colascione <dancol@google.com>
  originally back in 3/2018

Unfortunately it seems there is no way to not enable it.

Might indeed be a good idea to ping upstream and/or Daniel Colascione about
this.

#972344#20
Date:
2020-11-02 15:00:27 UTC
From:
To:
Hi again,
Chet answered that it can be disabled by disabling bracketed paste: https://lists.gnu.org/archive/html/bug-bash/2020-10/msg00082.html
but I don't think that is a good option, so I'll try to persuade him to make
this configurable separately.

#972344#25
Date:
2021-01-13 04:44:38 UTC
From:
To:
I also found this feature causes confusing in some terminals. However
disabling bracketed paste for BASH worked good enough for me: just
adding 'bind "set enable-bracketed-paste off"' into /etc/bash.bashrc.

#972344#30
Date:
2021-01-14 12:59:39 UTC
From:
To:
I just found another issue with this new BASH/Readline bug/feature.
Even with 'bind "set enable-bracketed-paste off"', BASH 5.1 still
behaving differently from previous versions: if pasted text contains
new lines, BASH 5.1 would still buffering the pasted text, rather than
evaluating the pasted text as commands immediately as I expected. This
behavior is very annoying for me because I'm very used to repeat some
commands quickly by copy-pasting them.

#972344#35
Date:
2021-01-14 13:06:09 UTC
From:
To:
While adding 'enable-bracketed-paste off' into inputrc appears fixed
this issue, no idea why it didn't fully work with bashrc only.

2021-01-14 20:59 GMT+08:00, 王昊然 <msl0000023508@gmail.com>: