mintty-bash-ssh weirdness after remote disconnect during vi session

Thomas Wolff towo@towo.net
Sat Jul 5 01:49:14 GMT 2025


Am 05.07.2025 um 03:04 schrieb Jim Garrison via Cygwin:
> 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.
Certainly a good guess. You can check your state with `stty -a`, for 
example about ^D behaviour.

> Is there a way to reset mintty other than closing and reopening it?
Try the `reset` command. Or the `Reset` function from the context menu, 
also via Alt+F8.



More information about the Cygwin mailing list