mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
LibLine: Defer handling SIGWINCH and SIGINT
Performing these immediately can introduce a race condition between the user's signal-related logic and LibLine's own, so defer the handlers to make sure they run when our terminal IO cannot interfere with the user's.
This commit is contained in:
parent
fb979dcf34
commit
7e5f1fa895
1 changed files with 2 additions and 2 deletions
|
@ -582,11 +582,11 @@ void Editor::initialize()
|
||||||
|
|
||||||
if (m_configuration.m_signal_mode == Configuration::WithSignalHandlers) {
|
if (m_configuration.m_signal_mode == Configuration::WithSignalHandlers) {
|
||||||
m_signal_handlers.append(Core::EventLoop::register_signal(SIGINT, [this](int) {
|
m_signal_handlers.append(Core::EventLoop::register_signal(SIGINT, [this](int) {
|
||||||
interrupted().release_value_but_fixme_should_propagate_errors();
|
Core::EventLoop::current().deferred_invoke([this] { interrupted().release_value_but_fixme_should_propagate_errors(); });
|
||||||
}));
|
}));
|
||||||
|
|
||||||
m_signal_handlers.append(Core::EventLoop::register_signal(SIGWINCH, [this](int) {
|
m_signal_handlers.append(Core::EventLoop::register_signal(SIGWINCH, [this](int) {
|
||||||
resized().release_value_but_fixme_should_propagate_errors();
|
Core::EventLoop::current().deferred_invoke([this] { resized().release_value_but_fixme_should_propagate_errors(); });
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue