diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 4 | ||||
| -rw-r--r-- | src/main.cc | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/client.cc b/src/client.cc index da178623..945b4d2f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -47,7 +47,11 @@ Client::Client(std::unique_ptr<UserInterface>&& ui, m_ui->set_ui_options(m_window->options()["ui_options"].get<UserInterface::Options>()); m_ui->set_on_key([this](Key key) { if (key == ctrl('c')) + { + auto prev_handler = set_signal_handler(SIGINT, SIG_IGN); killpg(getpgrp(), SIGINT); + set_signal_handler(SIGINT, prev_handler); + } else if (key.modifiers & Key::Modifiers::Resize) { m_window->set_dimensions(key.coord()); diff --git a/src/main.cc b/src/main.cc index eb08a9b7..28de0063 100644 --- a/src/main.cc +++ b/src/main.cc @@ -737,6 +737,7 @@ int run_server(StringView session, StringView server_init, { static bool terminate = false; set_signal_handler(SIGTERM, [](int) { terminate = true; }); + set_signal_handler(SIGINT, [](int) { terminate = true; }); if ((flags & ServerFlags::Daemon) and session.empty()) { write_stderr("-d needs a session name to be specified with -s\n"); |
