Skip to content

Revert #335 (Trap TSTP to handle C-z) - #535

Merged
tompng merged 1 commit into
ruby:masterfrom
brasic:master
Apr 24, 2023
Merged

tompng merged 1 commit into
ruby:masterfrom
brasic:master

Conversation

@brasic

@brasic brasic commented Apr 24, 2023

Copy link
Copy Markdown
Contributor

Fixes #466

#335 was an effort to address #321 (ed_quoted_insert doesn't work properly) but per the reporter the change did not work correctly.

Moreover, it introduced a major regression: Shell job control stopped working in all applications that use reline, notably IRB.

Shells send SIGTSTP in response to SUSP (C-z) to implement the suspension part of job control. Adding a handler for SIGTSTP opts out of this functionality. For a line oriented terminal program this should be avoided when possible (not to mention, this behavior diverges from readline's)

cc @aycabta

This PR was an effort to address ruby#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)

@tompng tompng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, It make sense to revert it 👍

@tompng
tompng merged commit 26383d2 into ruby:master Apr 24, 2023
matzbot pushed a commit to ruby/ruby that referenced this pull request Apr 24, 2023
(ruby/reline#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)

ruby/reline@26383d25b8

Co-authored-by: Carl Brasic <cbrasic@drwholdings.com>
@tompng

tompng commented Apr 24, 2023

Copy link
Copy Markdown
Member

(memo for the future)
Reading char like C-z can be implement by STDIN.raw(intr: false){STDIN.getc} instead of using Signal.trap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suspend not working in IRB Ruby 3.1.2

3 participants