mintty-bash-ssh weirdness after remote disconnect during vi session
Jim Garrison
jhg@acm.org
Sat Jul 5 01:04:00 GMT 2025
I've recently started seeing weirdness in mintty/bash after a connection
to a remote system is terminated by the remote. So far this seems to
happen only if the remote session was interrupted while vi was running.
After the session is interrupted, here's what happens on the local
(Windows/cygwin) mintty window:
* Ctrl-D just rings the tty "bell"
* Any change of window focus, in Windows, for the mintty window itself,
causes the tty bell to ring
I researched this by opening a second terminal session and using that to
kill various processes in the remote tree: ssh-bash-vi and found that
just killing the vi process causes the issue. On the remote system,
Ctrl-D produces the string "0;5u". Exiting the remote session (via
'exit') then leaves the local mintty in the same state.
I guess it's because vi remaps keystrokes and they didn't get reset when
vi died, but my usual goto 'stty sane' does not fix the problem, neither
on the remote nor local systems.
Is there a way to reset mintty other than closing and reopening it?
--
Jim Garrison
jhg@acm.org
More information about the Cygwin
mailing list