I am on windows, using putty to login to a root shell. It is currently running an interactive process which prompts for input to continue. Typical interactive process, its probably waiting on the next standard in prompt.

I lose my Wifi connection. And I reconnect to the internet with a completely different IP (from a 3G connection now). How can I resume this session? I need to get back into that shell for a number of reasons. One being that I really hate losing my context/history for each putty window every time I disconnect, which may be often. And of coursse, most dire is to be able to get back to interactive processes that are currently waiting for input.

In short:

  • Disconnected from internet
  • Connection is therefore closed or timedout with server
  • I come back to the internet on a new IP
  • I want to regain the same shell, and in its last/current state. So if an interactive process is running, it should resume everything (eg: tail, vi, less + current input buffer)
  • Is this scenario recoverable despite not having ran other processes first (eg: screen)

No, your session is likely gone. You'd already mentioned screen, so you know that solutions like it and tmux will reduce the impact of a connection loss the next time this occurs. If you anticipate any long-running processes in the future, train yourself to run from within a screen session before executing.


You may want to check screen

After reconnecting, use screen -ls to show the detached screen

Use screen -r to attach to a screen

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.