$ reptyr 123 will get the process with PID 123 and attach it to your terminal.
It will now accept input from stdin and output on stdout π.
$ git clone https://github.com/nelhage/reptyr.git
$ make
$ make installSometimes a command may take longer than expected to finish and you have to leave. And when you forgot to run it in screen or tmux, you can just disown this process and reptyr it inside screen/tmux. Then detach and go home, and re-attach screen/tmux whenever you need to π.
More info here: github.com/nelhage/reptyr