xterm (or x11) pastes are highlighted

Andy Koppe andy.koppe@gmail.com
Thu Mar 17 23:22:23 GMT 2022

On Thu, 17 Mar 2022 at 20:32, René Berber wrote:
> On 3/17/2022 1:03 PM, n952162 wrote:
> > Does anyone know how I can disable the highlighting that occurs when I
> > copy and paste in xterm?
> >
> > Escape sequences are added to achieve that and sometimes they're not
> > being properly interpreted.
> >
> > Why would I want that anyway?
> The same thing happens to (plain, non X windows) mintty.
> It started recently, maybe a couple of weeks.  No idea how to fix it,
> haven't really tried.
> Very annoying.

It came in with the readline 8.1 update in September last year, which
enabled "bracketed paste mode" by default. (I think zsh has had it
enabled for a few years.)

As n952162 said, it tells the terminal to enclose pasted text in
escape sequences.

There are several points to this:
- It stops accidental multi-line pastes from getting immediately
executed line by line.
- It makes it easier to undo a paste, as you can cut it out in one go
rather than deleting manually.
- Pasting can be faster, as the application can process the paste in
one chunk rather than treating it as char-by-char keyboard input.

But yep, sometimes it can go wonky, in particular when the bracketing
mode for some reason is left on for an application that doesn't expect

For readline, it can be disabled in ~/.inputrc:

set enable-bracketed-paste off


More information about the Cygwin mailing list