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
This commit is contained in:
ridiculousfish 2022-06-20 13:26:48 -07:00
parent f19a2711d4
commit 137a4ecdf5
2 changed files with 4 additions and 0 deletions

View File

@ -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
^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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()) {