mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
cc32b4f2a7
This is opt-in through a new feature flag "ampersand-nobg-in-token". When this flag and "qmark-noglob" are enabled, this command no longer needs quoting: curl https://example.com/thing?foo=bar&duran=duran Compared to the previous approach e1570a4 ("Let '&' only separate as the first char of a word"), this has some advantages: 1. "&&" and "&>" are no longer affected. They are still special, even if used between tokens without spaces, like "echo bar&>foo". Maybe this is not really *better*, but it avoids risking to annoy users by breaking the old variant. 2. "&" is still special if at the end of a token, like in "sleep 1&". Word movement is not affected by the semantics change, so Alt-F and friends still stop at every "&".
12 lines
176 B
Fish
12 lines
176 B
Fish
#RUN: %fish --features=ampersand-nobg-in-token %s
|
|
|
|
echo no&background
|
|
# CHECK: no&background
|
|
|
|
echo background&
|
|
# CHECK: background
|
|
|
|
echo background &
|
|
# CHECK: background
|
|
|
|
wait
|