Reset ImGui and skip restoring curses
Summary
Bugfixes "Exiting game with CTRL+C leaves console in mouse tracking mode"
Purpose of change
Change the non-Windows CTRL+C signal handler to possibly avoid #77011 .
Describe the solution
exit_handler stacked a SIGINT on the default handler but then called other UI functions when returning the handler.
Now it returns immediately, but right before reset the Im Gui instance pointer, calling its destructor.
Describe alternatives you've considered
Testing
- [x] ✔ Under WSL2/Ubuntu inside a Zellij pane. Before it left the screen game and the prompt without flashing cursor. After, it cleared the screen and the cursor was back flashing
- [x] ❌ Not tested under native Windows TUI, Android GUI nor MacOS GUI
I am not sure it fixes the escape codes mouse issue reported in #77011, I hope @sparr can test this branch.
Additional context
N/A
#8417 refers
@sparr have you seen this request for you to test?
Yes. I'll test as soon as I'm building a curses version again (full recompile takes hours for me).