Skip to content

Commit 26383d2

Browse files
authored
Revert #335 (Trap TSTP to handle C-z) (#535)
This PR was an effort to address #321 (ed_quoted_insert doesn't work properly) but per the reporter it did not work correctly. Moreover, it introduced a major regression: Shell job control stopped working in all applications that use reline, notably IRB. Bash and other shells send SIGTSTP in response to C-z to implement job suspension. Handling SIGSTP opts out of this functionality. For a line oriented terminal program this should be avoided (not to mention, this behavior diverges from readline's) Co-authored-by: Carl Brasic <cbrasic@drwholdings.com>
1 parent 43283b2 commit 26383d2

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

‎lib/reline/line_editor.rb‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,10 @@ def set_signal_handlers
239239
@old_trap.call if @old_trap.respond_to?(:call)
240240
end
241241
}
242-
begin
243-
@old_tstp_trap = Signal.trap('TSTP') {
244-
Reline::IOGate.ungetc("\C-z".ord)
245-
@old_tstp_trap.call if @old_tstp_trap.respond_to?(:call)
246-
}
247-
rescue ArgumentError
248-
end
249242
end
250243

251244
def finalize
252245
Signal.trap('INT', @old_trap)
253-
begin
254-
Signal.trap('TSTP', @old_tstp_trap)
255-
rescue ArgumentError
256-
end
257246
end
258247

259248
def eof?

0 commit comments

Comments
 (0)