From e0fcfc8a995761332752df40cda73f91528c5a0b Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Wed, 12 Jul 2023 19:41:04 +0100 Subject: [PATCH] less: Ignore SIGINT signals This matches the behavior of less on Linux and FreeBSD. --- Userland/Utilities/less.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Utilities/less.cpp b/Userland/Utilities/less.cpp index 51f66085ea..0a8f885c0b 100644 --- a/Userland/Utilities/less.cpp +++ b/Userland/Utilities/less.cpp @@ -554,6 +554,10 @@ ErrorOr serenity_main(Main::Arguments arguments) teardown_action.sa_handler = teardown_sigaction_handler; TRY(Core::System::sigaction(SIGTERM, &teardown_action, nullptr)); + struct sigaction ignore_action; + ignore_action.sa_handler = { SIG_IGN }; + TRY(Core::System::sigaction(SIGINT, &ignore_action, nullptr)); + Pager pager(filename, file, stdout, prompt); pager.init();