Skip to content

Rerender and enter raw mode again by SIGCONT - #727

Merged
ima1zumi merged 1 commit into
ruby:masterfrom
tompng:ctrlz_fg_continue
Jun 25, 2024
Merged

ima1zumi merged 1 commit into
ruby:masterfrom
tompng:ctrlz_fg_continue

Conversation

@tompng

@tompng tompng commented Jun 16, 2024 •

Copy link
Copy Markdown
Member

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
Comment thread lib/reline/io/ansi.rb
@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
Copy Markdown
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.

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

👍

@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