Tried using tagged release fish 3.0.2 as well as current master, built from source on Fedora 29, running in Gnome Terminal.
Problem
The command true && and true sets the exit code to 1 but is otherwise not indicated to be misbehaving.
Changing the command to true && and echo word reveals that the final statement is never executed (nothing is printed). Running true && and exits with code 2 instead and prints the help information for and. Running true && or exits with code 2 and prints the help info for or.
Similar results are observed with ||. false || and and false || or exit with code 2 and print the help info for and or or.
In all these cases, a command placed after the and or or is never executed.
Expected behaviour
I think that these two constructs shouldn't be allowed to be mixed in this way, as the results are unintuitive. The parser should expressly reject and or or when they follow && or ||, to prevent users accidentally creating structures that don't behave as they may anticipate, with commands that never execute.
Tried using tagged release fish 3.0.2 as well as current master, built from source on Fedora 29, running in Gnome Terminal.
Problem
The command
true && and truesets the exit code to 1 but is otherwise not indicated to be misbehaving.Changing the command to
true && and echo wordreveals that the final statement is never executed (nothing is printed). Runningtrue && andexits with code 2 instead and prints the help information forand. Runningtrue && orexits with code 2 and prints the help info foror.Similar results are observed with
||.false || andandfalse || orexit with code 2 and print the help info forandoror.In all these cases, a command placed after the
andororis never executed.Expected behaviour
I think that these two constructs shouldn't be allowed to be mixed in this way, as the results are unintuitive. The parser should expressly reject
andororwhen they follow&&or||, to prevent users accidentally creating structures that don't behave as they may anticipate, with commands that never execute.