diff --git a/CHANGELOG.md b/CHANGELOG.md index 8180e3925..2ecf562eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ - Error messages no longer include a (rather large) help summary and the stacktrace has been shortened (#3404, #5434). - fish now underlines every valid entered path instead of just the last one. - The `--debug` option has been extended to allow specifying categories. Categories may be listed via `fish --print-debug-categories`. -- `string replace` had an additional round of escaping in the replacement (not the match!), so escaping backslashes would require `string replace -ra '([ab])' '\\\\\\\$1' a`. A new feature flag `string-replace-fewer-backslashes` can be used to disable this, so that it becomes `string replace -ra '([ab])' '\\\\$1' a` (#5556). +- `string replace` had an additional round of escaping in the replacement (not the match!), so escaping backslashes would require `string replace -ra '([ab])' '\\\\\\\$1' a`. A new feature flag `regex-easyesc` can be used to disable this, so that it becomes `string replace -ra '([ab])' '\\\\$1' a` (#5556). - Some parser errors did not set `$status` to non-zero. This has been corrected (b2a1da602f79878f4b0adc4881216c928a542608). - `string` has a new `collect` subcommand that disables newline-splitting on its input. This is meant to be used as the end of a command substitution pipeline to produce a single output argument potentially containing internal newlines, such as `set output (some-cmd | string collect)`. Any trailing newlines are trimmed, just like `"$(cmd)"` substitution in sh. It also supports a `--no-trim-newlines` flag to disable trailing newline trimming, which may be useful when doing something like `set contents (cat filename | string collect -N)` (#159). - More of the documentation, including the tutorial, is now available as man pages as well. diff --git a/tests/checks/features-string-backslashes-off.fish b/tests/checks/features-string-backslashes-off.fish index 06593c9da..233cdcfc4 100644 --- a/tests/checks/features-string-backslashes-off.fish +++ b/tests/checks/features-string-backslashes-off.fish @@ -1,2 +1,2 @@ -#RUN: %fish --features 'no-string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' +#RUN: %fish --features 'no-regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' # CHECK: a\b\c diff --git a/tests/checks/features-string-backslashes.fish b/tests/checks/features-string-backslashes.fish index c73e1c0e6..596a12bd1 100644 --- a/tests/checks/features-string-backslashes.fish +++ b/tests/checks/features-string-backslashes.fish @@ -1,2 +1,2 @@ -#RUN: %fish --features 'string-replace-fewer-backslashes' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' +#RUN: %fish --features 'regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' # CHECK: a\\b\\c diff --git a/tests/status.out b/tests/status.out index b5cb078c0..4a94d8cd3 100644 --- a/tests/status.out +++ b/tests/status.out @@ -6,7 +6,7 @@ test_function # Future Feature Flags stderr-nocaret off 3.0 ^ no longer redirects stderr qmark-noglob off 3.0 ? no longer globs -string-replace-fewer-backslashes off 3.1 string replace -r needs fewer backslashes in the replacement +regex-easyesc off 3.1 string replace -r needs fewer \'s 1 2