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

Re: up-arrow no longer works right

On Thu, Mar 19, 2009 at 10:48 PM, Phil Pennock
<zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> On 2009-03-19 at 21:38 -0400, TjL wrote:
>> The oddity is that sometimes (usually after exiting from ssh and/or
>> screen) zsh seems to "forget" that, and pressing the up-arrow will
>> just go back through my history line by line, ignoring what I have
>> already typed.
>> Usually at that point I just exit the shell and open a new one, but
>> I'd really like to be able to kick-start my existing session if
>> possible (especially when I've ssh'd somewhere).
>> Any ideas what might cause this and (more importantly) what I can do to fix it?
> 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 :-/

> When things are working, if you run:
>  print -n '\e[?1h'
> do they stop working?


> 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.

'stty sane' did not fix it

> And:  print -n '\e[?1l'

that fixes it


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