Ensure resetting signal trap and output_io

parent 59ce9308
......@@ -373,11 +373,13 @@ module Pod
# @yield Code block in which inputs to {#puts} and {#print} methods will be printed to the piper.
#
def with_pager
prev_handler = Signal.trap('INT', 'IGNORE')
IO.popen((ENV['PAGER'] || 'less -R'), 'w') do |io|
Signal.trap('INT', 'IGNORE')
UI.output_io = io
yield
end
ensure
Signal.trap('INT', prev_handler)
UI.output_io = nil
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment