bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bracketed paste support


From: Chet Ramey
Subject: Re: [PATCH] bracketed paste support
Date: Wed, 05 Nov 2014 21:38:57 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/5/14 9:02 PM, Daniel Colascione wrote:
> On 10/29/2014 08:49 PM, Chet Ramey wrote:
>>> On 10/27/14, 6:35 PM, Daniel Colascione wrote:
>>>> This patch adds support for "bracketed paste mode" to readline. In
>>>> this mode, readline instructs the terminal to wrap pasted strings in
>>>> special control sequences so that programs can distinguish them from
>>>> typed input. 
>>>
>>> Thanks for the contribution.  I'll look at the code; the approach seems
>>> sound.
>>
>> It went in very easily, though I changed some things around.  This
>> will be in the next release of bash and readline.
> 
> The code appeared in the snapshot, so I was able to look at how you
> "changed some things around". You removed the code that tries to
> determine whether a terminal actually supports the feature; instead, you
> blindly send the enable sequence to *any* terminal when
> enable-bracketed-paste is enabled, with potentially unknown consequences
> on those terminals.
> 
> There's a comment in the code that indicates you expect users to enable
> the feature only on terminals where it's supported. I don't think it's
> reasonable to expect people to maintain a terminal database in their
> inputrc files.

People rarely use more than one, maybe two, different terminals or
terminal emulators.  I don't doubt that people who enable this feature
know enough to figure out whether or not it's going to work.

> Please restore the part of my patch,
> rl_bracketed_paste_probably_supported, that detects terminal support for
> this feature.

It doesn't `detect terminal support' as such.  It uses a heuristic to
guess whether or not a terminal supports bracketed paste by checking for
the presence of  a string in another termcap sequence.  Those kinds of
heuristics always end up having an exception.

- -- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Darwin)
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlRa30EACgkQu1hp8GTqdKsPvgCgnTgiPUAT27ADFyfZMErbr/F8
u+UAn1rYVN+4Ir/T+UEJEfLq2XO7fzvy
=w6Rz
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]