signal(3tcl)
π NAME π
signal β dynamically loadable signal handling for Tcl/Tk β¨
Like, your Tcl/Tk scripts can catch signals now? Iconic behavior. π«Ά
β¨ SYNOPSIS β¨
signal (add|delete|print|version) [options]
π COMMANDS π
πΈ add signo proc [-async]
Adds a signal handler for signal signo through proc proc, bestie. Signals can be provided by number, or the most common ones are provided by name (e.g., SIGHUP). The proc is any Tcl procedure, and it is evaluated when the signal comes in. It will be provided no arguments. No cap. π
Signal handlers have Posix semantics β they persist until reset. (so like, they do NOT just vibe out and disappear on their own, okay? you gotta reset them yourself.)
-asyncβ if this flag is used, the signal handler is created usingTcl_AsyncCreate(). Checks for the signal are very frequent (each evaluation) using this technique, but one doesn't know quite where evaluation is or how to handle errors in this situation. The code will evaluate the provided procedure in the current interpreter if available, and in the interpreter which added the signal handler otherwise. At least until a better scheme is suggested. (fr, that last part is literally in there π)
The -async is especially useful to interrupt "runaway" procs, or to cause a quick exit; the default mechanism simply waits for another MainLoop cycle. π¦
Not me explaining it twice but the vibe check here: default = chill, waits its turn. -async = main character energy, jumps in immediately, slightly chaotic about it. π
π signal delete signo
Restores handling of signal signo to the default ( SIG_DFL ). π
π signal print
Prints the handling of all signals with handlers. Formatted as
signal ----> procedure
or as
signal !---> procedure
if the signal is handled asynchronously β
(the ! is the little tell, iykyk π)
π signal print signo
Prints the procedure for handling signal signo. Prints the word UNHANDLED if no signal handler is active for that signal. π
π§ signal version
Returns the string representing the current version of the package πΈ
π AUTHOR π
Michael Schwartz <mschwart@nyx.net>. Tilman Kranz <tilde@tk-sls.de> patched this for wider portability on Linux π«Ά
okay that's the whole page bestie, you ate that π
This lil masterpiece is the Tcl Signal Extension, version 1.4.0.1, living its best life as part of Tcl β and that's the whole vibe check, periodt. πππ
π¦ where this page comes from
- debian bookworm: tcl-signal 1.4.5-1 Β· MIT-alike
- debian trixie: tcl-signal 1.4.5-1+b3 Β· MIT-alike
- ubuntu jammy: tcl-signal 1.4.4.1-2 Β· MIT-alike
- ubuntu noble: tcl-signal 1.4.5-1 Β· MIT-alike
- ubuntu questing: tcl-signal 1.4.5-1
- ubuntu resolute: tcl-signal 1.4.5-1build1 Β· MIT-alike
- ubuntu stonking: tcl-signal 1.4.5-1build1 Β· MIT-alike
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms