Skip to content

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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants