Long ssh/docker sessions result in strange behavior. #12332

Closed
opened 2026-01-31 03:12:39 +00:00 by claunia · 10 comments
Owner

Originally created by @StoneyEagle on GitHub (Jan 31, 2021).

Environment

Windows build number: Win32NT 10.0.21296.0 Microsoft Windows NT 10.0.21296.0 
Windows Terminal version: 1.5.10271.0

Any other software?
Docker 3.1.0

Steps to reproduce

Have a long (1+ hours) SSH session that's killed by the remote host or docker exec session that's killed by the docker daemon.

Expected behavior

Screen is cleared with only the username and path showing.

Actual behavior

After a long session gets terminated by the server or docker container the windows terminal is bugged with lots of strange behavior like adding characters when clicking the mouse.
image
Or when running a commando on the remote host that outputs many lines of code, the background color changes to blue after the outputted text.
The longer the session the stranger the behavior. Sounds like a memory leak.

Originally created by @StoneyEagle on GitHub (Jan 31, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Win32NT 10.0.21296.0 Microsoft Windows NT 10.0.21296.0 Windows Terminal version: 1.5.10271.0 Any other software? Docker 3.1.0 ``` # Steps to reproduce Have a long (1+ hours) SSH session that's killed by the remote host or docker exec session that's killed by the docker daemon. # Expected behavior Screen is cleared with only the username and path showing. # Actual behavior After a long session gets terminated by the server or docker container the windows terminal is bugged with lots of strange behavior like adding characters when clicking the mouse. ![image](https://user-images.githubusercontent.com/45034970/106394829-f220a200-63fe-11eb-8cbf-bd6cd288aa86.png) Or when running a commando on the remote host that outputs many lines of code, the background color changes to blue after the outputted text. The longer the session the stranger the behavior. Sounds like a memory leak.
claunia added the Issue-QuestionArea-VTResolution-AnsweredResolution-Duplicate labels 2026-01-31 03:12:39 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2021):

Those sequences of characters that are emitted when clicking the mouse seem to indicate that the remote server requested mouse input mode, but didn't reset the mode when connection was exited. This is something that happens from time to time, ESPECIALLY when an application like ssh or docker forcefully terminates the connection. When the connection is terminated forcefully, the remote app doesn't have a chance to reset the terminal modes itself. Then, when control returns to bash or whatever you're running locally, bash doesn't know that the remote app left the modes polluted. It doesn't know to reset the modes manually.

I believe reset should set these modes back to the default.

@zadjii-msft commented on GitHub (Feb 1, 2021): Those sequences of characters that are emitted when clicking the mouse seem to indicate that the remote server requested mouse input mode, but didn't reset the mode when connection was exited. This is something that happens from time to time, ESPECIALLY when an application like `ssh` or `docker` forcefully terminates the connection. When the connection is terminated forcefully, the remote app doesn't have a chance to reset the terminal modes itself. Then, when control returns to `bash` or whatever you're running locally, `bash` doesn't know that the remote app left the modes polluted. It doesn't know to reset the modes manually. I believe `reset` _should_ set these modes back to the default.
Author
Owner

@StoneyEagle commented on GitHub (Feb 1, 2021):

Yeah i let myself go on the mouse haha.
I never had this issue with putty before, it's a minor annoyance but you can't fix what you don't know that's broken.
Restarting the application fixes the issue. How do i reset the program without killing other tabs?

@StoneyEagle commented on GitHub (Feb 1, 2021): Yeah i let myself go on the mouse haha. I never had this issue with putty before, it's a minor annoyance but you can't fix what you don't know that's broken. Restarting the application fixes the issue. How do i reset the program without killing other tabs?
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2021):

I'm pretty sure the linux command reset should cover it - lemme know if it doesn't.

@zadjii-msft commented on GitHub (Feb 1, 2021): I'm pretty sure the linux command `reset` should cover it - lemme know if it doesn't.
Author
Owner

@StoneyEagle commented on GitHub (Feb 1, 2021):

Sure thing.

@StoneyEagle commented on GitHub (Feb 1, 2021): Sure thing.
Author
Owner

@DHowett commented on GitHub (Feb 1, 2021):

How do i reset the program without killing other tabs?

You can also just close the broken pane/tab without exiting the entire Terminal. 😄

@DHowett commented on GitHub (Feb 1, 2021): > How do i reset the program without killing other tabs? You can also just close the broken pane/tab without exiting the entire Terminal. :smile:
Author
Owner

@StoneyEagle commented on GitHub (Feb 3, 2021):

Now i got permission to crash stuff.... it takes forever lol
The reset command does not reset the mouse input.

@StoneyEagle commented on GitHub (Feb 3, 2021): Now i got permission to crash stuff.... it takes forever lol The reset command does not reset the mouse input.
Author
Owner

@DHowett commented on GitHub (Apr 13, 2021):

Just a quick question- what SSH client are you using here? Is it the one that comes with Windows, or one inside WSL? Is the docker client the Windows one?

@DHowett commented on GitHub (Apr 13, 2021): Just a quick question- what SSH client are you using here? Is it the one that comes with Windows, or one inside WSL? Is the docker client the Windows one?
Author
Owner

@StoneyEagle commented on GitHub (Apr 15, 2021):

I installed it from the MS store when you needed to run the insiders build to get it, so im not sure on that.
Long and sad story short I run a fresh copy of Windows 10 pro (retail) now and i haven't installed Docker on it yet.
The issue only happened to me once or twice with an external Docker server on Ubuntu 20.04 since then.
When it happens the arrow keys give me an audible error and weird characters typed out, typing any command and executing it seems to fix the issue.

@StoneyEagle commented on GitHub (Apr 15, 2021): I installed it from the MS store when you needed to run the insiders build to get it, so im not sure on that. Long and sad story short I run a fresh copy of Windows 10 pro (retail) now and i haven't installed Docker on it yet. The issue only happened to me once or twice with an external Docker server on Ubuntu 20.04 since then. When it happens the arrow keys give me an audible error and weird characters typed out, typing any command and executing it seems to fix the issue.
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2021):

Huh, you know what, this is actually the same underlying issue as /dup #8613

@zadjii-msft commented on GitHub (Apr 15, 2021): Huh, you know what, this is actually the same underlying issue as /dup #8613
Author
Owner

@ghost commented on GitHub (Apr 15, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 15, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12332