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 c...@case.edu http://tiswww.cwru.edu/~chet/