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

(cherry picked from commit 137a4ecdf5)
This commit is contained in:
ridiculousfish 2022-07-13 21:49:05 +08:00 committed by David Adam
parent 6e9590b220
commit 9397ede963
2 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,7 @@ This release also fixes a number of problems identified in fish 3.5.0.
- Completing ``git blame`` or ``git -C`` works correctly (:issue:`9053`).
- On terminals that emit a ``CSI u`` sequence for :kbd:`Shift-Space`, fish inserts a space instead of printing an error. (:issue:`9054`).
- ``status fish-path`` on Linux-based platforms could print the path with a " (deleted)" suffix (such as ``/usr/bin/fish (deleted)``), which is now removed (:issue:`9019`).
- Cancelling an initial command (from fish's ``--init-command`` option) with :kbd:`Control-C` no longer prevents configuration scripts from running (:issue:`9024`).
--------------

View File

@ -548,6 +548,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()) {