signals

package
v1.222.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package signals coordinates process-wide signal handling behavior.

Atmos installs a global SIGINT/SIGTERM handler in main() that exits the process. When a step hands the terminal to a foreground child process (interactive or TTY steps), Ctrl-C must be handled by the child, not by Atmos: the terminal delivers SIGINT to the whole foreground process group, and if Atmos exits first the child is killed by SIGPIPE mid-session.

This package provides a nestable suspension counter that the main signal handler consults before exiting on SIGINT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterruptExitSuspended

func InterruptExitSuspended() bool

InterruptExitSuspended reports whether the process-exit-on-SIGINT behavior is currently suspended because a foreground child process owns SIGINT.

func RegisterExitCleanup

func RegisterExitCleanup(cleanup func()) (deregister func())

RegisterExitCleanup registers a cleanup to run if the process exits through the signal handler. The returned deregister function removes it (idempotent) and must be called when the cleanup has been performed normally.

func RunExitCleanups

func RunExitCleanups()

RunExitCleanups runs all registered exit cleanups (most recent first). Called by the main signal handler before exiting the process.

func SuspendInterruptExit

func SuspendInterruptExit() (release func())

SuspendInterruptExit marks that a foreground child process owns SIGINT handling. It returns a release function that must be called when the child exits. Suspensions nest (e.g., a workflow TTY step inside a custom command), and the release function is idempotent.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL