Closing a Terminal Sends Coding Agents SIGHUP; Session Hosts Can Keep Them Running

Closing a terminal window can kill a coding agent that is running in it, because the kernel signals the shell that the terminal has hung up. The shell then forwards that signal to its background jobs, so unsaved work in the agent process is lost. Common workarounds such as nohup, disown, setsid, and tmux each address a different part of this chain. Only some of them leave the agent attached to a terminal the user can reconnect to. The article shows how to inspect process groups, sessions, and terminal ownership with ps to see what will be affected.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in