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

Should leave alt screen in panic hook #41

Closed
heaths opened this issue May 12, 2024 · 1 comment · Fixed by #42
Closed

Should leave alt screen in panic hook #41

heaths opened this issue May 12, 2024 · 1 comment · Fixed by #42
Assignees

Comments

@heaths
Copy link

heaths commented May 12, 2024

if let Err(err) = disable_raw_mode() {

Above this somewhere you should execute LeaveAlternateScreen to restore the buffer. Alternatively, define a struct that implements Drop to do that for you so you can bind it to a variable right after EnterAlternateScreen (or have it do both).

It’s a poor UX when TUIs don’t restore the user’s screen buffer, restore colors, etc.

@jfernandez
Copy link
Contributor

@heaths thanks for the suggestion. I made a PR, please take a look. #42

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 a pull request may close this issue.

2 participants