bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] fix a bug that bind -x '"\C-@": unix-command' does not work


From: Chet Ramey
Subject: Re: [PATCH] fix a bug that bind -x '"\C-@": unix-command' does not work
Date: Sun, 25 Mar 2018 16:40:58 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 3/20/18 12:35 PM, Koichi Murase wrote:

> Bash Version: 4.4
> Patch Level: 12
> Release Status: release
> 
> 
> Description:
> 
>   In bash-4.3.43, bash-4.4.12, and the latest commit of the devel
> branch, `bind -x' does not work for key sequences containing `\C-@'.

Thanks for the report and patch for this. Adding a new public interface
is the right way to do it.

I'm less certain about your second set of patches. This breaks backward
compatibility -- defined as what callers have come to expect -- in
several ways.

Philosophically, there should not be that much difference between a
function that accepts a `translated' key sequence and one that doesn't.
Even if a key sequence starts in an `untranslated' state, the caller
should be able to pass the translated version to rl_translate_keyseq
and have the result unchanged. It's an unusual key binding that can't
handle this, and I believe \C-@ is the only key sequence for which it
matters. None of the arrow key sequences in common use, for example,
contain it (that is your objection with _rl_term_ku, etc.).

Since I believe that for the most part `raw' key sequences such as those
in _rl_term_ku will pass through rl_translate_keyseq without modification,
I'm going to try the changes to rl_bind_keyseq_if_unbound_in_map and the
other changes in your second patch and see how it goes.

Chet

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



reply via email to

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