Re:How to move a running process into a tmux session (2020)
by severino on Wednesday October 05, 2022 @04:58AM
(#33092985)
Just for curiosity: what was the purpose of "disown"? If I recall correctly, it was used so the shell you used to launch the process didn't kill it using a "hang" signal or something like that. But I made a quick test and my shell doesn't seem to kill the background process launched from it, at least when I quit using ctrl + d.
Re:How to move a running process into a tmux session (2020)
by yrro on Thursday October 06, 2022 @06:08AM
(#33106468)
Behaviour depends on your shell. With Bash, for instance:
> The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped. [...] To prevent the shell from sending the SIGHUP signal to a particular job, it should be removed from the jobs table with the disown builtin (see Job Control Builtins) or marked to not receive SIGHUP using disown -h.
> If the huponexit shell option has been set with shopt (see The Shopt Builtin), Bash sends a SIGHUP to all jobs when an interactive login shell exits.
https://www.gnu.org/software/bash/manual/html_node/Signals.h...
Re:How to move a running process into a tmux session (2020)
by severino on Tuesday October 11, 2022 @04:29AM
(#33160769)
Thanks! I've been doing some tests with the huponexit option but it seems the tricky part was this: when an interactive login shell exits
I think I remember in Linux many years ago (more than 15, maybe) the behavior was present in shells spawned from your DE, but I may be wrong.
Re:How to move a running process into a tmux session (2020)
by aumerle on Tuesday October 04, 2022 @11:46PM
(#33090943)
Use a terminal like kitty that does not close as long as some launched program is still connected to it. https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.close_on_chi...
Re:How to move a running process into a tmux session (2020)
by jagged-chisel on Wednesday October 05, 2022 @06:44AM
(#33093679)
How does this compare to using
nohup <gui-app> &
?
Interesting. So far, my only ever use of disown was to decouple GUI apps that I launched from the terminal. I do that automatically now, as it's annoying when you forget, close the terminal, and a bunch of apps go away.