summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCarl Brasic <cbrasic@gmail.com>2023-04-24 11:31:07 -0500
committergit <svn-admin@ruby-lang.org>2023-04-24 16:31:13 +0000
commit8a132358d733d9cd81c6b83c9127e807a42c8ab9 (patch)
treec7635a7a29ad0bcec2daf886d8fa675b57afdce5 /lib
parentf8e7048348d022814736d0a7e49f2f2494db6a2f (diff)
[ruby/reline] Revert #335 (Trap TSTP to handle C-z)
(https://github.com/ruby/reline/pull/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) https://github.com/ruby/reline/commit/26383d25b8 Co-authored-by: Carl Brasic <cbrasic@drwholdings.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb11
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 6e2bd59f05..ad67e18745 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -239,21 +239,10 @@ class Reline::LineEditor
@old_trap.call if @old_trap.respond_to?(:call)
end
}
- begin
- @old_tstp_trap = Signal.trap('TSTP') {
- Reline::IOGate.ungetc("\C-z".ord)
- @old_tstp_trap.call if @old_tstp_trap.respond_to?(:call)
- }
- rescue ArgumentError
- end
end
def finalize
Signal.trap('INT', @old_trap)
- begin
- Signal.trap('TSTP', @old_tstp_trap)
- rescue ArgumentError
- end
end
def eof?