File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,6 @@ def readline(prompt = '', add_hist = false)
290
290
291
291
may_req_ambiguous_char_width
292
292
line_editor . reset ( prompt , encoding : Reline ::IOGate . encoding )
293
- line_editor . set_signal_handlers
294
293
if multiline
295
294
line_editor . multiline_on
296
295
if block_given?
@@ -320,6 +319,7 @@ def readline(prompt = '', add_hist = false)
320
319
line_editor . rerender
321
320
322
321
begin
322
+ line_editor . set_signal_handlers
323
323
prev_pasting_state = false
324
324
loop do
325
325
prev_pasting_state = Reline ::IOGate . in_pasting?
@@ -348,6 +348,11 @@ def readline(prompt = '', add_hist = false)
348
348
line_editor . finalize
349
349
Reline ::IOGate . deprep ( otio )
350
350
raise e
351
+ rescue Exception
352
+ # Including Interrupt
353
+ line_editor . finalize
354
+ Reline ::IOGate . deprep ( otio )
355
+ raise
351
356
end
352
357
353
358
line_editor . finalize
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ def set_signal_handlers
235
235
when 'EXIT'
236
236
exit
237
237
else
238
- @old_trap . call
238
+ @old_trap . call if @old_trap . respond_to? ( :call )
239
239
end
240
240
}
241
241
begin
You can’t perform that action at this time.
0 commit comments