From 56a72fe2b1e35acb0df4179ecc79c7873a6f5d49 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 13 Apr 2021 17:41:35 +0100 Subject: [PATCH] debrew/irb: fix trap handling --- Library/Homebrew/debrew/irb.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb index 6c2d285c13..af3c358c9d 100644 --- a/Library/Homebrew/debrew/irb.rb +++ b/Library/Homebrew/debrew/irb.rb @@ -5,8 +5,6 @@ require "irb" # @private module IRB - def self.parse_opts(argv: nil); end - def self.start_within(binding) unless @setup_done setup(nil, argv: []) @@ -19,7 +17,7 @@ module IRB @CONF[:IRB_RC]&.call(irb.context) @CONF[:MAIN_CONTEXT] = irb.context - trap("SIGINT") do + prev_trap = trap("SIGINT") do irb.signal_handle end @@ -28,6 +26,7 @@ module IRB irb.eval_input end ensure + trap("SIGINT", prev_trap) irb_at_exit end end