Ctrl+C interrupt [Crystal]

This commit is contained in:
Alexander Popov 2023-06-11 18:45:45 +03:00
parent bf0ab3e019
commit e4531a92d7
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
1 changed files with 9 additions and 0 deletions

View 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