Created
May 6, 2018 05:59
-
-
Save preetpalS/9ee3d273946865dc35da5be76566d5a0 to your computer and use it in GitHub Desktop.
Handling SIGBREAK signals with existing SIGINT signal handlers on Windows in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets up clean SIGBREAK signal handling on Windows by taking advantage of existing | |
# SIGINT signal handlers. | |
(-> { | |
Signal.trap(21) do | |
raise SignalException, 'INT' | |
end | |
}).call if Gem.win_platform? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment