Skip to content

Fix terminal on panic#93

Merged
Cretezy merged 3 commits intoCretezy:mainfrom
blazingjj:fix_terminal_on_panic
Feb 15, 2025
Merged

Fix terminal on panic#93
Cretezy merged 3 commits intoCretezy:mainfrom
blazingjj:fix_terminal_on_panic

Conversation

@dotdash
Copy link
Collaborator

@dotdash dotdash commented Feb 4, 2025

No description provided.

We don't explicitly hide the cursor, so we don't have to show it either.
The way the code is written, it's enforced by the type system, that the
backend uses Stdout, so we can just use Stdout directly. This makes it
easier to call restore_terminal() from other places, like e.g. a panic
handler to restore the terminal on panics and not leave the terminal
garbled and in a messed up state.
Otherwise, the terminal is left all messed up on panics.
@istudyatuni
Copy link
Collaborator

See also #75

Though I think your solution is good for handling unexpected panics

@dotdash
Copy link
Collaborator Author

dotdash commented Feb 7, 2025

Yeah, this is orthogonal to your PR. I'm regularly experiencing panics after e.g. jj undo or jj op restore which currently require two restarts of lazyjj before the output isn't garbled anymore. And we should just never leave the terminal in a messed up state.

@istudyatuni
Copy link
Collaborator

'm regularly experiencing panics after e.g. jj undo or jj op restore

Btw you can use #76 and #77 , or branch latest on my fork

@Cretezy Cretezy merged commit ccaf610 into Cretezy:main Feb 15, 2025
@DemvSteinbrink DemvSteinbrink deleted the fix_terminal_on_panic branch February 17, 2025 11:24
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.

3 participants