Terminal sometimes freezes after unlocking Windows #16498

Closed
opened 2026-01-31 05:13:51 +00:00 by claunia · 6 comments
Owner

Originally created by @ultrablue on GitHub (Jan 24, 2022).

Windows Terminal version

1.11.3471.0

Windows build number

10.0.19042.1466

Other Software

No response

Steps to reproduce

Here's what happens:

I'm in an ssh session in Windows Terminal (Version: 1.11.3471.0, Windows 10 20H2).

I need to step away from my machine, so I lock it by typing Windows-L.

When I come back, usually after an hour or so, and unlock the machine, the tab with the ssh session in it is completely non-responsive. By that I mean that it doesn't respond to keyboard input at all. It's not that I've been logged out of the remote, just dead. No errors or anything in the terminal.

I know that the machine wasn't asleep because the monitor was displaying a pretty picture when I logged in to find the situation I described above. However, it's possible that it tried to go to sleep while I was away.

This happens fairly often, maybe every time I lock the machine for a while.

Any ideas as to why that's happening and how I might prevent it?

Thanks!

Expected Behavior

Sometimes the ssh session is preserved. That's the ideal behavior.

Actual Behavior

The Terminal is frozen.

Originally created by @ultrablue on GitHub (Jan 24, 2022). ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.19042.1466 ### Other Software _No response_ ### Steps to reproduce Here's what happens: I'm in an ssh session in Windows Terminal (Version: 1.11.3471.0, Windows 10 20H2). I need to step away from my machine, so I lock it by typing Windows-L. When I come back, usually after an hour or so, and unlock the machine, the tab with the ssh session in it is completely non-responsive. By that I mean that it doesn't respond to keyboard input at all. It's not that I've been logged out of the remote, just dead. No errors or anything in the terminal. I know that the machine wasn't asleep because the monitor was displaying a pretty picture when I logged in to find the situation I described above. However, it's possible that it tried to go to sleep while I was away. This happens fairly often, maybe every time I lock the machine for a while. Any ideas as to why that's happening and how I might prevent it? Thanks! ### Expected Behavior Sometimes the ssh session is preserved. That's the ideal behavior. ### Actual Behavior The Terminal is frozen.
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-31 05:13:51 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 24, 2022):

@ultrablue Which ssh are you using? ssh.exe that ships with Windows? ssh from a WSL distro? Or some other ssh? And which version of ssh?

Does the issue repro in the vintage console host (conhost.exe) as well? Or only when sshing from the Terminal?

@zadjii-msft commented on GitHub (Jan 24, 2022): @ultrablue Which `ssh` are you using? `ssh.exe` that ships with Windows? `ssh` from a WSL distro? Or some other `ssh`? And which version of `ssh`? Does the issue repro in the vintage console host (`conhost.exe`) as well? Or only when `ssh`ing from the Terminal?
Author
Owner

@ultrablue commented on GitHub (Jan 25, 2022):

@zadjii-msft:

Hi, Mike:

Thanks for asking for clarification.

I hope this answers your questions:

$ ssh -V
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020

And:

C:\Users\xxxxx>ssh -V
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

I hope that's useful. Please let me know if there's anything else I can provide.

I haven't been able to reproduce the issue consistently. I left ssh sessions open in both WSL and the vintage console host yesterday, and when I came in this morning, both sessions had terminated (which is expected):

WSL:
$ client_loop: send disconnect: Broken pipe
And the vintage console host:
$ client_loop: send disconnect: Connection reset

I'm sorry I'm not able to be more informative. It's an annoyance-level issue for me, but really annoying.

Thanks,
Greg

@ultrablue commented on GitHub (Jan 25, 2022): @zadjii-msft: Hi, Mike: Thanks for asking for clarification. I hope this answers your questions: ``` $ ssh -V OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f 31 Mar 2020 ``` And: ``` C:\Users\xxxxx>ssh -V OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2 ``` I hope that's useful. Please let me know if there's anything else I can provide. I haven't been able to reproduce the issue consistently. I left ssh sessions open in both WSL and the vintage console host yesterday, and when I came in this morning, both sessions had terminated (which is expected): WSL: `$ client_loop: send disconnect: Broken pipe` And the vintage console host: `$ client_loop: send disconnect: Connection reset` I'm sorry I'm not able to be more informative. It's an annoyance-level issue for me, but really annoying. Thanks, Greg
Author
Owner

@lhecker commented on GitHub (Jan 25, 2022):

While it's possible that this is an issue with Windows Terminal, I faintly remember this being a thing on any OS with ssh.
Is this maybe relevant to your issue? https://superuser.com/questions/468584/ssh-connected-terminal-windows-hang-in-vm-after-waking-host-from-sleep

As described here: http://manpages.ubuntu.com/manpages/jammy/en/man1/ssh.1.html#escape%20characters

I think it's not really that the Terminal is freezing, but rather that ssh doesn't realize it's disconnected and the remote host not responding to the TCP packets. I believe this requires setting keep-alive values to fix and is not specifically an issue with the terminal.

@lhecker commented on GitHub (Jan 25, 2022): While it's possible that this is an issue with Windows Terminal, I faintly remember this being a thing on any OS with ssh. Is this maybe relevant to your issue? https://superuser.com/questions/468584/ssh-connected-terminal-windows-hang-in-vm-after-waking-host-from-sleep As described here: http://manpages.ubuntu.com/manpages/jammy/en/man1/ssh.1.html#escape%20characters I think it's not really that the Terminal is freezing, but rather that ssh doesn't realize it's disconnected and the remote host not responding to the TCP packets. I believe this requires setting keep-alive values to fix and is not specifically an issue with the terminal.
Author
Owner

@ultrablue commented on GitHub (Jan 26, 2022):

Leonard:

Huh, ok. Thanks for the info.

I'll try to remember the suggestions and the next time it happens, I'll give them a try.

Greg

@ultrablue commented on GitHub (Jan 26, 2022): Leonard: Huh, ok. Thanks for the info. I'll try to remember the suggestions and the next time it happens, I'll give them a try. Greg
Author
Owner

@zadjii-msft commented on GitHub (Jan 26, 2022):

I'm gonna close this as answered - if that doesn't end up helping, we can always reopen it ☺️

@zadjii-msft commented on GitHub (Jan 26, 2022): I'm gonna close this as answered - if that doesn't end up helping, we can always reopen it ☺️
Author
Owner

@ultrablue commented on GitHub (Feb 2, 2022):

Just a quick follow up.

@lhecker's suggestion above was helpful. Typing Enter ~ . did unstick the session.

Something else I noticed is that in the frozen state, the cursor was blinking. That just in case someone else comes across this.

Thanks again for your help! It's been helpful.

@ultrablue commented on GitHub (Feb 2, 2022): Just a quick follow up. @lhecker's suggestion above was helpful. Typing `Enter ` `~` `.` did unstick the session. Something else I noticed is that in the frozen state, the cursor was blinking. That just in case someone else comes across this. Thanks again for your help! It's been helpful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16498