snipplets.dev/code/Crystal/ctrl-c_interrupt.cr
2023-09-26 22:05:13 +03:00

10 lines
148 B
Crystal

LibC.signal Signal::INT.value, ->(s : Int32) {
puts "CTRL-C handler here!"
exit
}
Signal::INT.trap do
puts "CTRL-C handler here!"
exit
end