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

Use crossterm instead of console #42

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Use crossterm instead of console #42

merged 1 commit into from
Dec 2, 2024

Conversation

swenson
Copy link
Collaborator

@swenson swenson commented Nov 28, 2024

So that the terminal doesn't get corrupted after running the emulator.

Fixes #38

So that the terminal doesn't get corrupted after running the emulator.

Fixes #38
Copy link
Collaborator

@helloxiling helloxiling left a comment

Choose a reason for hiding this comment

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

Hi Chris, could you please elaborate on the root cause of the original issue? How does crossterm library help fix it? The code changes here are very similar to how console processed the key event.

@swenson
Copy link
Collaborator Author

swenson commented Dec 2, 2024

@helloxiling There's a long-standing issue with console where it leaves the terminal in a bad state when you hit Ctrl-C console-rs/console#172

The easiest way around this is to use a different crate that handles that edge case a little better. I did some testing and crossterm doesn't seem to have the same issue.

@swenson
Copy link
Collaborator Author

swenson commented Dec 2, 2024

Thanks!

@swenson swenson merged commit c030dd5 into main Dec 2, 2024
1 check passed
@swenson swenson deleted the fix-console branch December 2, 2024 20:59
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.

Stop corrupting the terminal when running the emulator
2 participants