SSH connection closes when resizing Windows Terminal after running `herdr` in remote server
Is this a reproducible bug?
- I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
- I reproduced this bug on the version and environment reported below using the exact steps provided.
Current behavior
When using Git Bash inside Windows Terminal, resizing the Windows Terminal window after connecting to a remote Linux server via SSH and running herdr causes the SSH connection to terminate unexpectedly.
After the connection is closed, moving the mouse causes unexpected mouse-event escape sequences such as 35;70;1M, 35;70;2M, and 35;69;3M to be printed continuously in the terminal.
This issue is similar to the behavior described in #3748. However, it does not occur when using standalone Git Bash or PowerShell 7 in Windows Terminal; both work normally.
Expected behavior
Resizing the Windows Terminal window should not terminate the SSH connection.
If herdr exits or the SSH connection is terminated, the terminal state should also be restored correctly. In particular, mouse tracking/reporting should be disabled so that mouse events are not emitted as raw escape sequences.
Reproduction
- Configure Git Bash as a profile in Windows Terminal.
- Open Git Bash in Windows Terminal.
- Connect to a remote server:
ssh myserver - Run:
herdr - Resize the Windows Terminal window by dragging its border with the mouse.
Impact
After resizing the Windows Terminal window:
- The SSH connection is unexpectedly terminated.
- The terminal displays a message similar to:
Connection to xxx closed. - After the SSH session has been closed, moving the mouse inside the terminal causes strings similar to the following to appear:
35;70;1M35;70;2M35;69;3M35;... - The strings continue to appear as the mouse is moved, suggesting that mouse tracking/reporting remains enabled after herdr or the SSH session terminates.
Environment
- Herdr version: 0.9.0
- Update channel (stable or preview): stable
- Operating system: Windows 11
- Terminal: Windows Terminal with Git Bash profile
- Shell, if relevant: Git Bash
Source: herdrdev/herdr