Is there a way to reattach to a specific terminal a process that was started from terminal with &? For instance, I started Kate by:
and now I want to reattach the process to a given terminal.
There are two issues here:
1) Death by HUP and avoiding that:
If you start a program in a shell and then end that shell then all child processes will be killed. This includes programs running in to background. (Those which you start with an & at the end of the commandm, like the `kate &; in your example, but also processes which you suspended with controlz and then 'bg').
Both will die once you close the shell.
You can work around this by
You can use nohup (e.g.
You can also start a program which emulates a terminal on its own and which is specially build so you can reconnect to it.
Example of screen usage:
Walk to another computer, or come back hours later. (or both :))
- log in or ssh to host.
Useful commands for screen:
screen -r Reconnect to the screen (e.g. from a different location)