Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Reset ImGui and skip restoring curses

Open alef opened this issue 1 year ago • 3 comments

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

alef avatar Oct 14 '24 18:10 alef

#8417 refers

alef avatar Oct 14 '24 18:10 alef

@sparr have you seen this request for you to test?

Maleclypse avatar Oct 16 '24 22:10 Maleclypse

Yes. I'll test as soon as I'm building a curses version again (full recompile takes hours for me).

sparr avatar Oct 16 '24 23:10 sparr