snipplets.dev/snipplets/code/Crystal/ctrl-c_interrupt.cr
2023-08-05 22:45:06 +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