debrew/irb: fix trap handling
This commit is contained in:
parent
ac87404c34
commit
56a72fe2b1
@ -5,8 +5,6 @@ require "irb"
|
|||||||
|
|
||||||
# @private
|
# @private
|
||||||
module IRB
|
module IRB
|
||||||
def self.parse_opts(argv: nil); end
|
|
||||||
|
|
||||||
def self.start_within(binding)
|
def self.start_within(binding)
|
||||||
unless @setup_done
|
unless @setup_done
|
||||||
setup(nil, argv: [])
|
setup(nil, argv: [])
|
||||||
@ -19,7 +17,7 @@ module IRB
|
|||||||
@CONF[:IRB_RC]&.call(irb.context)
|
@CONF[:IRB_RC]&.call(irb.context)
|
||||||
@CONF[:MAIN_CONTEXT] = irb.context
|
@CONF[:MAIN_CONTEXT] = irb.context
|
||||||
|
|
||||||
trap("SIGINT") do
|
prev_trap = trap("SIGINT") do
|
||||||
irb.signal_handle
|
irb.signal_handle
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -28,6 +26,7 @@ module IRB
|
|||||||
irb.eval_input
|
irb.eval_input
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
|
trap("SIGINT", prev_trap)
|
||||||
irb_at_exit
|
irb_at_exit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user