On 11/2/23 2:18 PM, John Tsiombikas wrote:
I'm running bash with 5.2.15 which apparently uses readline 8.2, on
debian sid. Since readline made enable-bracketed-paste default to on, I
noticed garbage on some terminals, specifically pre-ANSI ones.

It turns out readline spews the ANSI sequence ESC[?2004h to enable
bracketed paste, regardless of the setting of TERM. I tested with
TERM=vt52 and TERM=adm3a, and I'm still seeing that sequence on every
line.

There's no portable way to determine whether a particular terminal supports
bracketed paste. Readline does suppress it for dumb terminals, but the vt52
and adm3a are just smart enough to pass its tests.

You can turn off bracketed paste in a startup file (bash or readline)
depending on the value of TERM.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/


Reply via email to