SIGINT

The interrupt signal, sent to the foreground program when you press Control C, asking it to stop.

In more detail

Programs usually exit when they receive it, and a command ended by it reports exit status 130 (128 + 2). A script can trap INT to clean up before leaving.

Examples

trap 'echo interrupted; exit 130' INT
In Node.js, process.on("SIGINT", handler) replaces the default exit, so the handler must end the process itself once cleanup is done.

Related terms

Taught in

References

Certification courses