Fix regression causing "nosuchcommand || hello" to short-circuit

Commit 3534c07584 (Adopt the new AST in parse_execution, 2020-07-03)
added to parse_execution_context_t::run_job_conjunction an early
return when any job in a job conjunction fails to launch.  This causes
"nosuchcommand || echo hello" to not execute the continuation.

Fix this by restoring the previous behavior.

Fixes #12654
This commit is contained in:
Johannes Altmanninger
2026-04-28 23:55:04 +08:00
parent e2b18fc5b6
commit 1034945690
3 changed files with 8 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ Regression fixes:
-----------------
- Vi mode ``dl`` (:issue:`12461`).
- (from 4.6) Backspace after newline (:issue:`12583`).
- (from 3.2) ``nosuchcommand || echo hello`` executes the right hand side again (:issue:`12654`).
fish 4.6.0 (released March 28, 2026)
====================================

View File

@@ -1749,9 +1749,6 @@ fn run_job_conjunction(
}
let mut result = self.run_1_job(ctx, &job_expr.job, associated_block);
for jc in &job_expr.continuations {
if result != EndExecutionReason::Ok {
return result;
}
if let Some(reason) = self.check_end_execution(ctx) {
return reason;
}

View File

@@ -138,3 +138,10 @@ not --help >/dev/null
echo $status
# CHECK: 0
# CHECK: 0
PATH= cat || echo cat failed
# CHECKERR: fish: Unknown command: cat
# CHECKERR: {{.*}}/andandoror.fish (line 142):
# CHECKERR: PATH= cat || echo cat failed
# CHECKERR: ^~^
# CHECK: cat failed