Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Zle bug



On Feb 1, Wez Furlong wrote

> Hi,
> 
> I am reporting a bug that is present in zsh 3.1.2 and also 3.1.2-zefram3.
> I have mentioned it before (when 3.1.2 was first released) but it does not
> appear to have been addressed.
> 
> Here's a demonstration:
> 
> % > zsh -f
> % > echo $ZSH_VERSION
> 3.0.5
> % > bindkey  '\e[A'   up-line-or-search
> % > who
> wez      tty3     Feb  1 00:37
> root     tty4     Feb  1 00:42
> root     tty2     Jan 31 16:51
> wez      tty5     Feb  1 01:42
> % > ls
> Admin              Personal           UNI                root
> Amiga              Povray             Wez-Crontab        spambounce.tar.gz
> Dave               Src                mail.vim           tmp
> PCMCIA             Stuff              mbox
> % > w
> 
> At this point I press cursor up
> 
> % > who
> 
> This is correct.

I'd say "no, it's a bug" ;-)

> And here is the bug, with 3.1.2:
> 
> % > zsh -f
> % > echo $ZSH_VERSION
> 3.1.2
> % > bindkey  '\e[A'   up-line-or-search
> % > who
> wez      tty3     Feb  1 00:37
> root     tty4     Feb  1 00:42
> root     tty2     Jan 31 16:51
> wez      tty5     Feb  1 01:42
> % > ls
> Admin              Personal           UNI                root
> Amiga              Povray             Wez-Crontab        spambounce.tar.gz
> Dave               Src                mail.vim           tmp
> PCMCIA             Stuff              mbox
> % > w
> 
> Pressing cursor up produces a beep.
> 
> % > w

Looking at the manpages, I found this:

          up-line-or-search
          Move  up a line in the buffer, or if already at the
          top line, search backward in the history for a line
          beginning with the first word in the buffer.

It works like this:
~> zsh -f
% echo $ZSH_VERSION
3.1.2
% bindkey '\e[A' up-line-or-search 
% ls -l
total 1503
[snip]
% pwd
/home/jean-luc
% l_
   ^
   Cursor here, hit cursor-up -> beeps, because the _word_ l wasn't
   found in the history
% ls_
    ^
    Cursor here, hit cursor-up -> expands to ls -l

This behaviour seems to be OK, looking at the documentation...

Perhaps this can't be done in zsh-3.1.2 as it is now, we may need
something like "up-line-or-history-beginning-search-backward". ;-)

CU,
Thomas [using history-beginning-search-backward]

-- 
  -- Thomas Köhler   Email:  jean-luc@xxxxxxxxxxxxxxxxx
          <><                     jean-luc@xxxxxxx
   IRC: jeanluc  Channels:  #star_trek #linuxger #ixthys #knf
             WWW: http://home.pages.de/~jeanluc/



Messages sorted by: Reverse Date, Date, Thread, Author