File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -170,10 +170,13 @@ def reset(prompt = '', encoding:)
170
170
@old_trap . call
171
171
end
172
172
}
173
- @old_tstp_trap = Signal . trap ( :TSTP ) {
174
- Reline ::IOGate . ungetc ( "\C -z" . ord )
175
- @old_tstp_trap . call if @old_tstp_trap . respond_to? ( :call )
176
- }
173
+ begin
174
+ @old_tstp_trap = Signal . trap ( :TSTP ) {
175
+ Reline ::IOGate . ungetc ( "\C -z" . ord )
176
+ @old_tstp_trap . call if @old_tstp_trap . respond_to? ( :call )
177
+ }
178
+ rescue ArgumentError
179
+ end
177
180
Reline ::IOGate . set_winch_handler do
178
181
@rest_height = ( Reline ::IOGate . get_screen_size . first - 1 ) - Reline ::IOGate . cursor_pos . y
179
182
old_screen_size = @screen_size
@@ -215,7 +218,10 @@ def reset(prompt = '', encoding:)
215
218
216
219
def finalize
217
220
Signal . trap ( 'SIGINT' , @old_trap )
218
- Signal . trap ( 'SIGTSTP' , @old_tstp_trap )
221
+ begin
222
+ Signal . trap ( 'SIGTSTP' , @old_tstp_trap )
223
+ rescue ArgumentError
224
+ end
219
225
end
220
226
221
227
def eof?
You can’t perform that action at this time.
0 commit comments