Skip to content

Instantly share code, notes, and snippets.

@preetpalS
Created May 6, 2018 05:59
Show Gist options
  • Save preetpalS/9ee3d273946865dc35da5be76566d5a0 to your computer and use it in GitHub Desktop.
Save preetpalS/9ee3d273946865dc35da5be76566d5a0 to your computer and use it in GitHub Desktop.
Handling SIGBREAK signals with existing SIGINT signal handlers on Windows in Ruby
# 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