Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerender and enter raw mode again by SIGCONT #727

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Jun 16, 2024

When reline is suspended by Ctrl-z and then resumed by fg command, reline needs to rerender the screen.
STDIN.raw/cooked is reset, so we need to call raw!.
Calling winch handler on SIGCONT because window might be resized while suspended. In that case, WINCH handler won't be called.

@tompng tompng added the bug Something isn't working label Jun 16, 2024
@old_cont_handler = Signal.trap('CONT') do
@input.raw!(intr: true) if @input.tty?
# Rerender the screen. Note that screen size might be changed while suspended.
handler.call
Copy link
Member

Choose a reason for hiding this comment

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

📝 Set @resized to true using set_signal_handlers, and rerender with handle_resized.

Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

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

👍

@ima1zumi ima1zumi merged commit be45660 into ruby:master Jun 25, 2024
40 checks passed
@tompng tompng deleted the ctrlz_fg_continue branch June 25, 2024 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants