Public bug reported:

My basic problem is that if I connect with ssh (from a windows
11/ucrt64/mintty/zsh host) to an Ubuntu 22.04 server with a zsh shell
(and my custom .zshrc), and then I disconnect, my terminal (so the
mintty/zsh on win11) will not recognize anymore the arrows keys (up,
down...).

After a lot of debugging, here is what I found:

This is the DECCKM VT capability which is messed up: check
https://vt100.net/docs/vt510-rm/DECCKM.html and
https://github.com/mintty/mintty/wiki/Keycodes#cursor-keys for more
info.

This setting will set an alternative code for cursor keys, e.g. '^[OA'
for 'Up' instead of '^[[A'.

It is possible to query the DECCKM status with DECRPM: 
https://vt100.net/docs/vt510-rm/DECRPM.html
$ print '\e[?1$p'
/1;2$y_   (reset)
/1;1$y_   (or set)

Or more simply, press ^V + UP.

After many tries, I identified the file /etc/zsh/zshrc executed just at
the beginning of the ssh session to be the culprit. I just renamed it
and everything was corrected.

I checked the last version of zsh-common (
https://launchpad.net/ubuntu/+archive/primary/+files/zsh-
common_5.9-8ubuntu2_all.deb ) and it is the same that my broken version
(Ubuntu 22.04), so I suppose the problem is still the same.

** Affects: zsh (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2136314

Title:
  /etc/zsh/zshrc mess up VT settings (DECCKM) with ssh

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/2136314/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to