mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-29 22:55:51 +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.top()();
|
||||||
on_exit_functions.pop();
|
on_exit_functions.pop();
|
||||||
}
|
}
|
||||||
|
std::raise(signal);
|
||||||
if (signal == SIGINT)
|
|
||||||
std::exit(SIGINT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto install_signal_handler = [](int sig, SignalHandler handler) {
|
auto install_signal_handler = [](int sig, SignalHandler handler) {
|
||||||
@ -278,6 +276,8 @@ CapturedMouse ScreenInteractive::CaptureMouse() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScreenInteractive::Loop(Component component) {
|
void ScreenInteractive::Loop(Component component) {
|
||||||
|
on_exit_functions.push([this] { ExitLoopClosure()(); });
|
||||||
|
|
||||||
// Install a SIGINT handler and restore the old handler on exit.
|
// Install a SIGINT handler and restore the old handler on exit.
|
||||||
auto old_sigint_handler = std::signal(SIGINT, OnExit);
|
auto old_sigint_handler = std::signal(SIGINT, OnExit);
|
||||||
on_exit_functions.push(
|
on_exit_functions.push(
|
||||||
|
Loading…
Reference in New Issue
Block a user