[KongchangAI]
Concept

SIGHUP

A hangup signal in Unix/Linux systems, sent to relevant processes when a terminal connection is disconnected. Its default behavior is to terminate the process, so programs that must survive terminal disconnection need to ignore or handle this signal explicitly.

Timeline (last 90 days)

Oct 18

Any application architecture that wants agents to outlive the terminal window should include: a separate long-lived process in its own session that ignores SIGHUP, holding the agent's pty master, with the UI connecting as a client over a socket, buffering output when no one is attached, replacing the UI binary without affecting the running host, and the host exiting on its own once there are no sessions.

Unverified50%
Oct 18

If a process group becomes an orphaned group and a member of it is in a stopped state, POSIX specifies that the system sends SIGHUP and SIGCONT to all members of that group.

Unverified50%
Oct 18

Before exiting after receiving SIGHUP, bash resends SIGHUP to all of its running or stopped jobs.

Unverified50%
Oct 18

On macOS since 10.15, the HUP option of the default login shell zsh is on by default, sending SIGHUP to running jobs when the shell exits.

Unverified50%
Oct 18

When a terminal window is closed, the kernel sends SIGHUP to the session leader process (usually the shell), which then forwards that SIGHUP to the jobs in its job table, causing the AI coding agent process to terminate.

Unverified50%
Oct 18

nohup works by setting SIGHUP to be ignored, so that a background process is not terminated by SIGHUP when the terminal closes.

Unverified50%
Oct 18

disown removes the job from the shell's job table, so when the shell receives SIGHUP it has no job to forward, and the process therefore does not receive SIGHUP.

Unverified50%
Oct 18

setsid makes a process run in an independent session with no controlling terminal, thereby avoiding SIGHUP when the terminal hangs up.

Unverified50%
Oct 18

The tmux session process actively detaches from the controlling terminal (becoming a daemon), so it is not affected by the SIGHUP signal.

Unverified50%
Aug 31

The nohup command achieves simple background persistence by making the process ignore the SIGHUP signal.

Unverified50%

1 more timeline events

All Facts (11)

Unverified

Any application architecture that wants agents to outlive the terminal window should include: a separate long-lived process in its own session that ignores SIGHUP, holding the agent's pty master, with the UI connecting as a client over a socket, buffering output when no one is attached, replacing the UI binary without affecting the running host, and the host exiting on its own once there are no sessions.

50%
Unverified

If a process group becomes an orphaned group and a member of it is in a stopped state, POSIX specifies that the system sends SIGHUP and SIGCONT to all members of that group.

50%
Unverified

Before exiting after receiving SIGHUP, bash resends SIGHUP to all of its running or stopped jobs.

50%
Unverified

On macOS since 10.15, the HUP option of the default login shell zsh is on by default, sending SIGHUP to running jobs when the shell exits.

50%
Unverified

When a terminal window is closed, the kernel sends SIGHUP to the session leader process (usually the shell), which then forwards that SIGHUP to the jobs in its job table, causing the AI coding agent process to terminate.

50%
Unverified

nohup works by setting SIGHUP to be ignored, so that a background process is not terminated by SIGHUP when the terminal closes.

50%
Unverified

disown removes the job from the shell's job table, so when the shell receives SIGHUP it has no job to forward, and the process therefore does not receive SIGHUP.

50%
Unverified

setsid makes a process run in an independent session with no controlling terminal, thereby avoiding SIGHUP when the terminal hangs up.

50%
Unverified

The tmux session process actively detaches from the controlling terminal (becoming a daemon), so it is not affected by the SIGHUP signal.

50%
Unverified

The nohup command achieves simple background persistence by making the process ignore the SIGHUP signal.

50%
Unverified

When a terminal window is closed, all child processes running within it receive a SIGHUP signal and terminate.

50%

Source Articles