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

review: reset the terminal when interrupted #180

Merged
merged 1 commit into from
Nov 17, 2024
Merged

review: reset the terminal when interrupted #180

merged 1 commit into from
Nov 17, 2024

Conversation

figsoda
Copy link
Member

@figsoda figsoda commented Nov 14, 2024

workaround for console-rs/dialoguer#248

Copy link

@ThinkChaos ThinkChaos left a comment

Choose a reason for hiding this comment

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

This does fix it, thanks!

Comment on lines +130 to +131
// make sure ctrlc handler has reset the terminal
sleep(Duration::from_millis(16));

Choose a reason for hiding this comment

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

Why not reset the cursor here directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

it probably doesn't matter, but either way there has to be a ctrlc handler, otherwise the program gets interrupted before the mouse is restored

@figsoda figsoda merged commit 1ba60e2 into main Nov 17, 2024
4 checks passed
@figsoda figsoda deleted the ctrlc branch November 17, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants