0

I use Ubuntu 18.04 desktop and sometimes I use an ssh connection in terminal to a server. When I switch from terminal to another application such as Gedit, Nautilus etc, and come back to the terminal, then I can't type any ssh connection commands in the terminal.

It appears that the terminal window gets focus, but it doesn't receive any input. The terminal window does not accept any keyboard commands, and ctrl-c, ctrl-q etc do nothing.

With the mouse I can select the text in the window, but I cannot write anything.

I searched the net and I read that this can be caused by an ssh timeout, so the connection is interrupted and the terminal becomes unresponsive.
The thing that bothers me about this is that there is no warning, and above all, that the window must be closed with the X button.

How can I avoid this problem?

Zanna
  • 70,465

1 Answers1

1

I had the exact same problem, on the same OS: an old ssh session timed out and CTRL+C/D/Z had no effect, session just sits there.

The only way I managed to regain control of the console without closing it entirely was to send the ssh escape key (default ~), by typing: ~. and hitting .

Related: https://unix.stackexchange.com/questions/2919/kill-an-unresponsive-ssh-session-without-closing-the-terminal