[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bracketed paste ANSI sequence on non-ANSI terminals
From: |
Mike Jonkmans |
Subject: |
Re: bracketed paste ANSI sequence on non-ANSI terminals |
Date: |
Mon, 6 Nov 2023 17:11:16 +0100 |
On Mon, Nov 06, 2023 at 05:16:51PM +0200, John Tsiombikas wrote:
> On Mon, Nov 06, 2023 at 08:57:28AM -0500, Chet Ramey wrote:
> > On 11/4/23 4:35 AM, John Tsiombikas wrote:
> >
> > >Detecting if a terminal is not ANSI-compatible and refraining from
> > >transmitting any, such as the bracketed paste in question, could be done
> > >at the very least by comparing termcap escape sequences for various
> > >things, if there's no better way I'm not aware of.
> >
> > Well, let's expand on these "various things." If you want to write up a
> > patch that encapsulates your meaning, I'll take a look at it.
>
> I will not submit a patch, but I can explain what I meant. For instance
> if termcap says the sequence for homing the cursor is "ESC [ H" or the
> 8bit equivalent, then you're probably dealing with an ANSI-compatible
> terminal, that will happily either take heed or correctly parse and
> ignore your bracketed paste sequence.
>
> As I said, there might be a more direct way that I'm not aware of, but
> this sounds like a clear indication making it easy to classify terminals
> into ANSI and non-ANSI.
...
In your $INPUTRC, ~/.inputc or /etc/inputrc
you can use the `$if term=...' construct.
E.g.:
$if term=adm3a
set enable-bracketed-paste off
$endif
See also:
man readline
--
Regards, Mike Jonkmans