Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: up-arrow no longer works right
- X-seq: zsh-users 13946
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: TjL <luomat@xxxxxxxxx>
- Subject: Re: up-arrow no longer works right
- Date: Fri, 20 Mar 2009 00:15:57 -0700
- Cc: Zsh Users List <zsh-users@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=d200902; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=TQTOMx4sVF+2Ct/SKfTnQC+uF4wO3QpJN0juRYuVKwhaByZjc4HTB/FdRQ+K7xQtPf08lXQ3SQE8Yhtp13fSuphCEtP8/JPyLLgoO1FTWwaZ3VQTYovnT9dcUYSRgePMI9scgImBVNMz8aT/jA/LZbbVta6d+ShrSbRKsksVpno=;
- In-reply-to: <d2ecb10b0903192303h1f9b0487g335cd5335f708ff@xxxxxxxxxxxxxx>
- Mail-followup-to: TjL <luomat@xxxxxxxxx>, Zsh Users List <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <d2ecb10b0903191838y68e1dfbbsa80289a52256eb2a@xxxxxxxxxxxxxx> <20090320024835.GA64103@xxxxxxxxxxxxxxxxxxxx> <d2ecb10b0903192303h1f9b0487g335cd5335f708ff@xxxxxxxxxxxxxx>
On 2009-03-20 at 02:03 -0400, TjL wrote:
> On Thu, Mar 19, 2009 at 10:48 PM, Phil Pennock
> <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> > Perhaps the cursor keys have been put into application mode and your
> > terminal type isn't supporting them in that mode?
>
> I don't know what that means :-/
Any terminal emulator with a heritage that stretches back to emulating
VT100 terminals will implement a certain set of features, with
"standard" escape sequences for them. This includes xterm and all the
knock-offs.
One of these features is the ability to have the numeric keypad keys
send different characters to the normal digits, etc. That's
"application mode". The cursor keys can be put into a mode where they
send escape sequences which are similar to the application mode escape
sequences. That seems to be more common. I don't know enough about
such things to know why any application bothers to do this.
Normally, any program which changes the terminal mode will change it
back against afterwards, but if the program did not shut down cleanly,
or didn't get a chance to, then this won't happen.
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).
> > If you run "bindkey", you'll see two batches for the two sets of cursor
> > keys; for me:
> > "^[OA" up-line-or-history
> > "^[OB" down-line-or-history
> > "^[OC" forward-char
> > "^[OD" backward-char
> > [...]
> > "^[[A" up-line-or-history
> > "^[[B" down-line-or-history
> > "^[[C" forward-char
> > "^[[D" backward-char
> >
> > If those two sets ^[O<foo> and ^[[<foo> differ then this might explain
> > it. ÂSo, (1) bind both sets the same and (2) see if "stty sane" helps.
> > And: Âprint -n '\e[?1l'
>
> that fixes it
So, bind ^[OA as well as ^[[A and the keys will still work even in
application mode.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author