From a918cabf5e1c148bbdde81213016e852a21914a4 Mon Sep 17 00:00:00 2001 From: David Adam Date: Wed, 7 Apr 2021 22:43:49 +0800 Subject: [PATCH] feature flags: default stderr-nocaret to on --- CHANGELOG.rst | 1 + src/fish_tests.cpp | 6 ++---- src/future_feature_flags.cpp | 2 +- tests/checks/status.fish | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aa35ac8c4..171036b0e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,7 @@ Syntax changes and new commands Deprecations and removed features --------------------------------- - The ``fish_history`` value "default" is no longer an alias for "fish" (:issue:`7650`). +- Redirection to standard error with the ``^`` character has been disabled by default. It can be turned back on using the ``stderr-nocaret`` feature flag, but will eventually be disabled completely (:issue:`7105`). Scripting improvements ---------------------- diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index 42f1f8186..c096c788c 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -664,7 +664,7 @@ static void test_tokenizer() { using tt = token_type_t; const token_type_t types[] = { tt::string, tt::redirect, tt::string, tt::redirect, tt::string, tt::string, - tt::string, tt::redirect, tt::redirect, tt::string, tt::pipe, tt::redirect, + tt::string, tt::string, tt::string, tt::pipe, tt::redirect, tt::andand, tt::background, tt::oror, tt::pipe, tt::andand, tt::oror, tt::background, tt::pipe, tt::string, tt::end, tt::string}; @@ -771,8 +771,6 @@ static void test_tokenizer() { if (get_redir_mode(L"<") != redirection_mode_t::input) err(L"redirection_type_for_string failed on line %ld", (long)__LINE__); - if (get_redir_mode(L"^") != redirection_mode_t::overwrite) - err(L"redirection_type_for_string failed on line %ld", (long)__LINE__); if (get_redir_mode(L">") != redirection_mode_t::overwrite) err(L"redirection_type_for_string failed on line %ld", (long)__LINE__); if (get_redir_mode(L"2>") != redirection_mode_t::overwrite) @@ -1885,7 +1883,7 @@ static void test_feature_flags() { say(L"Testing future feature flags"); using ft = features_t; ft f; - do_test(!f.test(ft::stderr_nocaret)); + do_test(f.test(ft::stderr_nocaret)); f.set(ft::stderr_nocaret, true); do_test(f.test(ft::stderr_nocaret)); f.set(ft::stderr_nocaret, false); diff --git a/src/future_feature_flags.cpp b/src/future_feature_flags.cpp index fff9cac6e..b539a9a93 100644 --- a/src/future_feature_flags.cpp +++ b/src/future_feature_flags.cpp @@ -16,7 +16,7 @@ features_t::features_t() { features_t features_t::global_features; const features_t::metadata_t features_t::metadata[features_t::flag_count] = { - {stderr_nocaret, L"stderr-nocaret", L"3.0", L"^ no longer redirects stderr", false}, + {stderr_nocaret, L"stderr-nocaret", L"3.0", L"^ no longer redirects stderr", true}, {qmark_noglob, L"qmark-noglob", L"3.0", L"? no longer globs", false}, {string_replace_backslash, L"regex-easyesc", L"3.1", L"string replace -r needs fewer \\'s", false}, diff --git a/tests/checks/status.fish b/tests/checks/status.fish index cc2e8dbfc..ccee6e764 100644 --- a/tests/checks/status.fish +++ b/tests/checks/status.fish @@ -54,12 +54,12 @@ eval test_function # Future Feature Flags status features -#CHECK: stderr-nocaret off 3.0 ^ no longer redirects stderr +#CHECK: stderr-nocaret on 3.0 ^ no longer redirects stderr #CHECK: qmark-noglob off 3.0 ? no longer globs #CHECK: regex-easyesc off 3.1 string replace -r needs fewer \'s status test-feature stderr-nocaret echo $status -#CHECK: 1 +#CHECK: 0 status test-feature not-a-feature echo $status #CHECK: 2