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

Re: up-arrow no longer works right



On 2009-03-20 00:15:57 -0700, Phil Pennock wrote:
> So, if you want the up-key to always invoke a particular widgit, then
> you need to bind *two* different escape sequences: both the normal \e[A
> and also \eOA (where the escape sequence ESC is in more modern
> environments written \e but in older setups is written ^[ instead).

Alternatively, I think that something like

  [[ -n $TTY && -n $terminfo ]] && print -n "$terminfo[rmkx]" > $TTY

in precmd() should work around this problem.

Also, I've recently had a problem with the arrow keys after typing
Ctrl-Z (to background a graphical application) and "bg": sometimes
the escape sequences are output to the terminal, even though they
are interpreted by zsh; typing [Enter] is sufficient to get the
normal behavior back.

For instance:

vin:~> emacs file1                                                    <14:28:38
^Zzsh: suspended  eclient file1
zsh: exit 20
vin:~[20]> bg                                                         <14:28:47
[1]  + continued  eclient file1
vin:~>                                                                <14:28:48
[1]  + done       eclient file1
vin:~> emacs file1                                                    <14:28:51
^Zzsh: suspended  eclient file1
zsh: exit 20
vin:~[20]> bg                                                         <14:28:54
[1]  + continued  eclient file1
vin:~> ^[[A^[[A^[[A                                                   <14:28:55
bg         
bg: job already in background

As you can see, there's no problem after the first bg. But after the
second one, I get a ^[[A (in normal characters, so this is not like
quote-insert, where ^[ appears in reverse video) for each up-arrow.
When I hit [Enter], one can see that zsh recalled the first "bg"
command from the history.

This is with the zsh 4.3.9-3 Debian package.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



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