Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nepsilon/640004a8df36c6326ced54a035bb5db2 to your computer and use it in GitHub Desktop.

Select an option

Save nepsilon/640004a8df36c6326ced54a035bb5db2 to your computer and use it in GitHub Desktop.
How to re-attach a running process to the terminal πŸ“Ί β€” First published in fullweb.io issue #69

How to re-attach a running process to the terminal πŸ“Ί

In short:

$ 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 πŸ‘.

Installation:

$ git clone https://github.com/nelhage/reptyr.git
$ make
$ make install

But when is it really useful?

Sometimes 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment