zsh-users
 help / color / Atom feed
* up-arrow for history 'broken' after ssh
@ 2020-07-28 12:37 TJ Luoma
  2020-07-28 17:16 ` Lewis Butler
  2020-07-28 17:42 ` Roman Perepelitsa
  0 siblings, 2 replies; 4+ messages in thread
From: TJ Luoma @ 2020-07-28 12:37 UTC (permalink / raw)
  To: Zsh MailingList

I have run into this before, and I know it's a relatively simple fix,
but it has been a few years and my Googling has not turned up the
answer.

I have my zsh history set up such that if I start typing a few letters
and then press the 'up arrow' it will only show me history items which
match the letters I have already typed.

However, when I ssh from my Mac to a Linux machine (which has a
different zsh setup), and then exit ssh, my 'up arrow' goes back one
at a time, regardless of whether or not I have typed anything first.

Can someone remind me how to fix this?

Thanks!

Tj

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: up-arrow for history 'broken' after ssh
  2020-07-28 12:37 up-arrow for history 'broken' after ssh TJ Luoma
@ 2020-07-28 17:16 ` Lewis Butler
  2020-07-28 17:42 ` Roman Perepelitsa
  1 sibling, 0 replies; 4+ messages in thread
From: Lewis Butler @ 2020-07-28 17:16 UTC (permalink / raw)
  To: Zsh Users

On 28 Jul 2020, at 06:37, TJ Luoma <luomat@gmail.com> wrote:
> 
> I have run into this before, and I know it's a relatively simple fix,
> but it has been a few years and my Googling has not turned up the
> answer.
> 
> I have my zsh history set up such that if I start typing a few letters
> and then press the 'up arrow' it will only show me history items which
> match the letters I have already typed.
> 
> However, when I ssh from my Mac to a Linux machine (which has a
> different zsh setup), and then exit ssh, my 'up arrow' goes back one
> at a time, regardless of whether or not I have typed anything first.
> 
> Can someone remind me how to fix this?

Maybe this page?

<https://coderwall.com/p/jpj_6q/zsh-better-history-searching-with-arrow-keys>


-- 
ɹןʇnqן
<mailto:lbutler@covisp.net>
tel:+1.303.219.0564




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: up-arrow for history 'broken' after ssh
  2020-07-28 12:37 up-arrow for history 'broken' after ssh TJ Luoma
  2020-07-28 17:16 ` Lewis Butler
@ 2020-07-28 17:42 ` Roman Perepelitsa
  2020-07-29  0:48   ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Roman Perepelitsa @ 2020-07-28 17:42 UTC (permalink / raw)
  To: TJ Luoma; +Cc: Zsh MailingList

On Tue, Jul 28, 2020 at 2:39 PM TJ Luoma <luomat@gmail.com> wrote:
>
> However, when I ssh from my Mac to a Linux machine [...]
> and then exit ssh, my 'up arrow' goes back one at a time

You almost certainly have different zle widgets bound to different key
sequences that correspond to up-arrow-key in raw and application
modes.

There are several ways to fix this.

1. Use `bind -s` to translate application mode key sequences to raw
and then bind only raw sequences to widgets (or the other way around).
This is my favorite.
2. Bind all widgets twice if you want to bind them to arrow keys or home/end.
3. Hook zle-line-init and change terminal mode to application/raw.
This is the most error prone method of the three. It breaks whenever
terminal mode is changed by a widget (as opposed to by a command) and
when you use some zsh plugins.

Roman.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: up-arrow for history 'broken' after ssh
  2020-07-28 17:42 ` Roman Perepelitsa
@ 2020-07-29  0:48   ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2020-07-29  0:48 UTC (permalink / raw)
  To: TJ Luoma; +Cc: Zsh MailingList

On Tue, Jul 28, 2020 at 10:43 AM Roman Perepelitsa
<roman.perepelitsa@gmail.com> wrote:
>
> On Tue, Jul 28, 2020 at 2:39 PM TJ Luoma <luomat@gmail.com> wrote:
> >
> > However, when I ssh from my Mac to a Linux machine [...]
> > and then exit ssh, my 'up arrow' goes back one at a time
>
> There are several ways to fix this.

4. (Assumes ssh starts a login shell) Change terminal mode back to raw
in ~/.zlogout on the remote machine
5. Create a script to set as the ProxyCommand in your .ssh/config that
resets the terminal mode after ssh exits

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 12:37 up-arrow for history 'broken' after ssh TJ Luoma
2020-07-28 17:16 ` Lewis Butler
2020-07-28 17:42 ` Roman Perepelitsa
2020-07-29  0:48   ` Bart Schaefer

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git