mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
On SIGINT, raise signal again.
When SIGINT is intercepted, quit the run loop and raise the signal again. I am not sure this addresses: https://github.com/ArthurSonzogni/FTXUI/issues/117 Maybe?
This commit is contained in:
parent
18d1b04b7a
commit
478d7e8bca
@ -205,9 +205,7 @@ void OnExit(int signal) {
|
||||
on_exit_functions.top()();
|
||||
on_exit_functions.pop();
|
||||
}
|
||||
|
||||
if (signal == SIGINT)
|
||||
std::exit(SIGINT);
|
||||
std::raise(signal);
|
||||
}
|
||||
|
||||
auto install_signal_handler = [](int sig, SignalHandler handler) {
|
||||
@ -278,6 +276,8 @@ CapturedMouse ScreenInteractive::CaptureMouse() {
|
||||
}
|
||||
|
||||
void ScreenInteractive::Loop(Component component) {
|
||||
on_exit_functions.push([this] { ExitLoopClosure()(); });
|
||||
|
||||
// Install a SIGINT handler and restore the old handler on exit.
|
||||
auto old_sigint_handler = std::signal(SIGINT, OnExit);
|
||||
on_exit_functions.push(
|
||||
|
Loading…
Reference in New Issue
Block a user