From 137a4ecdf53b949be72ae29f4acce325a2f33c81 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 20 Jun 2022 13:26:48 -0700 Subject: [PATCH] Clear signals after running initial commands If you run an initial command via `fish -c`, and that command is cancelled e.g. via control-C, then ensure that the cancellation signal is cleared before running config files. Fixes #9024 --- CHANGELOG.rst | 1 + src/fish.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e445f3fb3..0ea4d77ec 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,7 @@ Scripting improvements Interactive improvements ------------------------ +- Cancelling an initial command via control-C no longer prevents configuration scripts from running (:issue:`9024`). New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/fish.cpp b/src/fish.cpp index c90f450db..ab124db5c 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -545,6 +545,9 @@ int main(int argc, char **argv) { res = run_command_list(parser, opts.postconfig_cmds, {}); } + // Clear signals in case we were interrupted (#9024). + signal_clear_cancel(); + if (!opts.batch_cmds.empty()) { // Run the commands specified as arguments, if any. if (get_login()) {