If I press Ctrl-C while my program is running it exits and prints SIGINT: Interrupted by Ctrl-C
.
How do I ignore the Ctrl-C interrupt in Nim on Linux? Thanks in advance.
If I press Ctrl-C while my program is running it exits and prints SIGINT: Interrupted by Ctrl-C
.
How do I ignore the Ctrl-C interrupt in Nim on Linux? Thanks in advance.
You can control the behaviour of Ctrl+C
with setControlCHook:
proc ctrlc() {.noconv.} =
echo "Ctrl+C fired!"
setControlCHook(ctrlc)
Now CtrlC calls the ctrlc
procedure. It's up to that procedure to ignore the SIGINT, or to clean the house and exit with quit.
© 2022 - 2024 — McMap. All rights reserved.