Ctrl+C interrupt [Crystal]
This commit is contained in:
parent
bf0ab3e019
commit
e4531a92d7
9
~/Crystal/ctrl-c_interrupt.cr
Normal file
9
~/Crystal/ctrl-c_interrupt.cr
Normal file
@ -0,0 +1,9 @@
|
||||
LibC.signal Signal::INT.value, ->(s : Int32) {
|
||||
puts "CTRL-C handler here!"
|
||||
exit
|
||||
}
|
||||
|
||||
Signal::INT.trap do
|
||||
puts "CTRL-C handler here!"
|
||||
exit
|
||||
end
|
Loading…
Reference in New Issue
Block a user