Skip to content

Commit

Permalink
Added code to restore the terminal state on crash on curses (CleverRa…
Browse files Browse the repository at this point in the history
…ven#73272)

* Added code to restore the terminal state on crash on curses build.

* Update src/crash.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* changing the way i am doing this based on suggestion

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
katemonster33 and github-actions[bot] authored Apr 27, 2024
1 parent 7e7510c commit 0e4a71b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/crash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <string>
#include <typeinfo>

#if !(defined(WIN32) || defined(TILES) || defined(CYGWIN))
#include <curses.h>
#endif

#if defined(TILES)
#include "sdl_wrappers.h"
#endif
Expand Down Expand Up @@ -135,6 +139,9 @@ extern "C" {
default:
return;
}
#if !(defined(WIN32) || defined(TILES)) && !defined(CYGWIN)
endwin();
#endif
if( !isDebuggerActive() ) {
log_crash( "Signal", msg );
}
Expand Down

0 comments on commit 0e4a71b

Please sign in to comment.