bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] fix bind -X quoting


From: Chet Ramey
Subject: Re: [PATCH] fix bind -X quoting
Date: Wed, 26 Jul 2023 16:06:53 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 7/24/23 1:13 PM, Chet Ramey wrote:

You could do it if you allowed, say

bind -x '"\eX": \"command with spaces\" \"x\"'

and then stripped the backslashes before calling rl_generic_bind, but
that's not exactly backwards compatible either.

Thinking about it some more, you can do it like this:

bind -x $'"\\eX": \'"command with spaces" "x"\''

since bind -x allows single-quoted strings as the command to execute,
and $'...' allows backslash-escaped single quotes.

If we ran the command string through rl_translate_keyseq, it would allow
backslash-escaped double quotes and strip the backslashes, but you get
the rest of the backslash processing that you probably don't want.

It's just not transitive.

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




reply via email to

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