Unix signal handling - SIGINT, SIGTERM, SIGHUP with handler patterns and best practices
Provides Unix signal handling guidance with patterns for Bash, C, and Python.
/plugin marketplace add mwguerra/claude-code-plugins/plugin install terminal-specialist@mwguerra-marketplace[SIGINT | SIGTERM | SIGHUP | all]You are providing signal handling guidance. Follow these steps:
The user needs help with: $ARGUMENTS
Read the signal handling documentation:
skills/terminal-docs/references/09-signals.md
| Signal | Number | Keyboard | Description |
|---|---|---|---|
| SIGHUP | 1 | Hangup | |
| SIGINT | 2 | Ctrl+C | Interrupt |
| SIGQUIT | 3 | Ctrl+\ | Quit |
| SIGKILL | 9 | Force kill | |
| SIGTERM | 15 | Graceful terminate | |
| SIGTSTP | 20 | Ctrl+Z | Terminal stop |
| SIGCONT | 18 | Continue | |
| SIGWINCH | 28 | Window resize |
trap 'cleanup' EXIT
trap 'echo "Interrupted"' INT TERM
struct sigaction sa;
sa.sa_handler = handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
sigaction(SIGINT, &sa, NULL);
import signal
signal.signal(signal.SIGINT, handler)
Based on the user's query: