After a period of inactivity, SSH will have no respond #18480

Closed
opened 2026-01-31 06:15:23 +00:00 by claunia · 2 comments
Owner

Originally created by @jayagami on GitHub (Sep 16, 2022).

Windows Terminal version

1.14.2281.0

Windows build number

10.0.19044.0

Other Software

Thanks for your great works.
Honestly, Termianl is my favorite ssh client 😀 The connection is stored in the config file, so I can just open terminal and fire.

But the problem is , the SSH connection will be disconnected after a period of inactive. And the terminal doesn't give any information, it just can't do anything in the current tab unless you press ctrl+c to return to powershell.

I am not sure if it is a terminal problem, but other ssh client keeps connecting server.

Steps to reproduce

  1. start a ssh connection
  2. do something
  3. keep it backgroud for a while
  4. return to this tab
  5. There is no response until you press ctrl+s

Expected Behavior

ssh connections are constantly open

Actual Behavior

ssh have no respond

Originally created by @jayagami on GitHub (Sep 16, 2022). ### Windows Terminal version 1.14.2281.0 ### Windows build number 10.0.19044.0 ### Other Software Thanks for your great works. Honestly, Termianl is my favorite ssh client 😀 The connection is stored in the config file, so I can just open terminal and fire. But the problem is , the SSH connection will be disconnected after a period of inactive. And the terminal doesn't give any information, it just can't do anything in the current tab unless you press ctrl+c to return to powershell. I am not sure if it is a terminal problem, but other ssh client keeps connecting server. ### Steps to reproduce 1. start a ssh connection 2. do something 3. keep it backgroud for a while 4. return to this tab 5. There is no response until you press ctrl+s ### Expected Behavior ssh connections are constantly open ### Actual Behavior ssh have no respond
claunia added the Needs-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 06:15:23 +00:00
Author
Owner

@lhecker commented on GitHub (Sep 16, 2022):

I am not sure if it is a terminal problem, but other ssh client keeps connecting server.

What is the other SSH client that works for you?

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 (Sep 16, 2022): > I am not sure if it is a terminal problem, but other ssh client keeps connecting server. What is the other SSH client that works for you? 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

@jayagami commented on GitHub (Sep 18, 2022):

I am not sure if it is a terminal problem, but other ssh client keeps connecting server.

What is the other SSH client that works for you?

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.

Thanks for your answer.
I think you are right, I missed some SSH parameters

    ServerAliveInterval 300
    ServerAliveCountMax 2

Now I'll add it to my ssh config file and see if it's working.

@jayagami commented on GitHub (Sep 18, 2022): > > I am not sure if it is a terminal problem, but other ssh client keeps connecting server. > > What is the other SSH client that works for you? > > 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. Thanks for your answer. I think you are right, I missed some SSH parameters ``` ServerAliveInterval 300 ServerAliveCountMax 2 ``` Now I'll add it to my ssh config file and see if it's working.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18480