Replies: 1 comment
-
I'm having the same issue. Maybe this should be in the issues instead of Q&A. auto wrapped_component = CatchEvent(renderer, [&](Event event) {
// Allow the user to quit using 'q' or ESC ---------------------------------
if (event == Event::Character('q') || event == Event::Escape)
{
screen.Exit();
stop_signal = true;
return true;
}
});
screen.Loop(wrapped_component); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, I just want to say this library is amazing. Thanks!
I'm using ScreenInteractive::Fullscreen and starting the screen loop from main(). I've got a separate thread that posts Event::Custom to the screen at 10Hz which causes a render. When I need to exit the program, I'm calling ExitLoopClosure()(), but from a different thread. This causes the screen.Loop() to stop (as expected) and my program (from main) unwinds just fine.
However, occasionally the terminal is left responding to mouse or key events for a brief period after the program exits printing various terminal escape codes and other junk. I have to reset the terminal to get it back the way it was and it is causing problems with automated testing.
Any idea what I'm doing wrong?
Thank you!
-Tyler
Beta Was this translation helpful? Give feedback.
All reactions