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

Added code to restore the terminal state on crash on curses #73272

Merged
merged 4 commits into from Apr 27, 2024

Conversation

katemonster33
Copy link
Contributor

@katemonster33 katemonster33 commented Apr 25, 2024

Summary

Bugfixes "On curses build, clean up the terminal during a crash"

Purpose of change

Fixes: #73049

Describe the solution

When we crash, before printing the backtrace, call the 'reset' utility from the command line. this resets the terminal to a default state so we can print the backtrace without a bunch of garbage. and also to make the terminal usable after the game crashes.

Describe alternatives you've considered

We could implement calling into ncurses to turn off all the terminal features we've set, like the cursor visibility, but the problem is that because the program is in a crashed state, we can't rely on much. calling an external tool is safer.

Testing

Load a game, open debug menu, go to Game -> crash game. see that the back trace prints OK and the terminal state is restored to default.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Apr 25, 2024
src/crash.cpp Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Apr 25, 2024
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 25, 2024
@katemonster33 katemonster33 reopened this Apr 27, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 27, 2024
@I-am-Erk I-am-Erk merged commit 0e4a71b into CleverRaven:master Apr 27, 2024
37 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

imgui does not clean up the screen when the game crashes
2 participants