[Pkg-zsh-devel] [Bug 1048212] Re: Auto-completion via bindkey "^[[A" not working in zsh 5.0.0-1ubuntu1

Frank Terbeck ft at bewatermyfriend.org
Fri Sep 21 13:55:17 UTC 2012


Axel Beckert wrote:
> Hendrik Spiegel wrote in https://bugs.launchpad.net/bugs/1048212:
>> Subject: Auto-completion via bindkey "^[[A" not working in zsh 5.0.0-1ubuntu1
>
> Not sure, but this is possibly fixed in 5.0.0-2 (of Debian Experimental):
>
>    [ Frank Terbeck ]
>    * [0b3b271c] Do not use echoti {smkx,rmkx} unconditionally
>    * [ab84f082] Print directly from $terminfo instead of using `echoti'
>
> Frank, can you confirm (or deny) that?

No, that is not it. Using hard-coded escape sequences is wrong. Picking
them out of $terminfo is the right thing to do. To be able to do that,
we're setting the terminal into smkx mode when the line editor is
active.

Then - and only then - are the values from $terminfo valid.

The code the up-cursor key sends (I bet that's the key we're talking
about), is described by `kcuu1' in terminfo (it might be "^[OA" - but
you really shouldn't care), thus:

  bindkey "${terminfo[kcuu1]}" whatever-widget

will work.

But we actually do a bit better: We're setting a `$key[]' hash that maps
human readable names of a few widely used keys to their sequences. With
that, this will work, too:

  bindkey "${key[Up]}" whatever-widget


If you don't want any of our key setup, add this to your ~/.zshenv (this
is, by the way, in the packages NEWS file):

  DEBIAN_PREVENT_KEYBOARD_CHANGES=yes


If you do not want any of our setup to be active, just do this in your
~/.zshenv file:

  setopt no_global_rcs


>>   What I found out is that searching using up/down keys does work in zsh-
>>   beta
>
> That's expected. zsh-beta is likely to vanish in the future and
> already no more in sync with zsh's packaging.
>
>>   and zsh-static but NOT in zsh
>
> _That_ sounds like a bug. zsh-static and zsh are expected to behave
> identically as they're built from the same source package (while
> zsh-beta is an independent source package).
>
> Cc'ing the Debian Zsh Packaging Team as the zsh-static vs zsh
> difference is possibly an issue which is still present in Debian's zsh
> package, too. (And for the question to Frank above.)

I don't know about the -static package. If it doesn't include the code
from zsh's `terminfo' module, then we don't do any of the smkx setup,
because we can't get the required escape sequence from `$terminfo'.

I don't know anything about that. Maybe Clint does (Cc:ing).


Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



More information about the Pkg-zsh-devel mailing list