newlines near and
causes conditionals to be treated like commands
#12845
Labels
needs-triage
An issue that hasn't had any proper look
syntax
Changes to the grammar or syntax beyond parser bugfixes
unhelpful-error
The error message you observe is not helpful to identify the problem
First off, thanks for nushell. It's awesome.
Describe the bug
It's pretty jarring to have this work:
...and then when you make one of those conditionals longer and decide to split them on separate lines for readability, it breaks:
Something about the new lines appears to be making
and
behave like a shell command, not a logical operator.Expected behavior
I expect
and
to mean the same thing regardless of adjacent whitespace changes.Screenshots
If you put round braces around the arguments to
and
you get the same error that you would if you ran:$ and true
Configuration
Additional context
If altering
and
or the parsing isn't feasible, maybe users just need a nudge towards this syntax instead, which works fine.I could imagine examples in
help where
andhelp and
which would help users avoid this.The text was updated successfully, but these errors were encountered: