diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 57438cc1b..841a882c4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,4 @@ -fish ?.?.? (released ???) +fish 4.3.0 (released ???) ========================= Notable improvements and fixes @@ -11,6 +11,10 @@ Interactive improvements ------------------------ - When typing immediately after starting fish, the first prompt is now rendered correctly. +Improved terminal support +------------------------- +- New :ref:`feature flag ` ``omit-term-workarounds`` can be turned on to prevent fish from trying to work around incompatible terminals. + For distributors and developers ------------------------------- - ``fish_key_reader`` and ``fish_indent`` are now hardlinks to ``fish``. diff --git a/doc_src/language.rst b/doc_src/language.rst index 37c388889..16d0558cf 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -2027,6 +2027,7 @@ You can see the current list of features via ``status features``:: mark-prompt on 4.0 write OSC 133 prompt markers to the terminal ignore-terminfo on 4.1 do not look up $TERM in terminfo database query-term on 4.1 query the TTY to enable extra functionality + omit-term-workarounds off 4.3 skip workarounds for incompatible terminals Here is what they mean: @@ -2041,6 +2042,7 @@ Here is what they mean: - ``query-term`` allows fish to query the terminal by writing escape sequences and reading the terminal's response. This enables features such as :ref:`scrolling `. If you use an incompatible terminal, you can -- for the time being -- work around it by running (once) ``set -Ua fish_features no-query-term``. +- ``omit-term-workarounds`` prevents fish from trying to work around incompatible terminals. These changes are introduced off by default. They can be enabled on a per session basis:: diff --git a/src/future_feature_flags.rs b/src/future_feature_flags.rs index 905dd2e05..bc159e0f7 100644 --- a/src/future_feature_flags.rs +++ b/src/future_feature_flags.rs @@ -36,6 +36,9 @@ pub enum FeatureFlag { /// Whether we are allowed to query the TTY for extra information. query_term, + + /// Do not try to work around incompatible terminal. + omit_term_workarounds, } struct Features { @@ -140,6 +143,14 @@ pub struct FeatureMetadata { default_value: true, read_only: false, }, + FeatureMetadata { + flag: FeatureFlag::omit_term_workarounds, + name: L!("omit-term-workarounds"), + groups: L!("4.3"), + description: L!("skip workarounds for incompatible terminals"), + default_value: false, + read_only: false, + }, ]; thread_local!( @@ -204,6 +215,7 @@ const fn new() -> Self { AtomicBool::new(METADATA[6].default_value), AtomicBool::new(METADATA[7].default_value), AtomicBool::new(METADATA[8].default_value), + AtomicBool::new(METADATA[9].default_value), ], } } diff --git a/src/reader/reader.rs b/src/reader/reader.rs index 99744ee47..0177c3ae6 100644 --- a/src/reader/reader.rs +++ b/src/reader/reader.rs @@ -75,8 +75,7 @@ use crate::fd_readable_set::poll_fd_readable; use crate::fds::{AutoCloseFd, make_fd_blocking, wopen_cloexec}; use crate::flog::{FLOG, FLOGF}; -use crate::future_feature_flags; -use crate::future_feature_flags::FeatureFlag; +use crate::future_feature_flags::{self, FeatureFlag}; use crate::global_safety::RelaxedAtomicBool; use crate::highlight::{ HighlightRole, HighlightSpec, autosuggest_validate_from_history, highlight_shell, diff --git a/tests/checks/status.fish b/tests/checks/status.fish index d74ac3979..80fc3433d 100644 --- a/tests/checks/status.fish +++ b/tests/checks/status.fish @@ -55,16 +55,10 @@ eval test_function #CHECK: test_function # Future Feature Flags -status features +status features | head -n3 #CHECK: stderr-nocaret on 3.0 ^ no longer redirects stderr (historical, can no longer be changed) #CHECK: qmark-noglob on 3.0 ? no longer globs #CHECK: regex-easyesc on 3.1 string replace -r needs fewer \'s -#CHECK: ampersand-nobg-in-token on 3.4 & only backgrounds if followed by a separator -#CHECK: remove-percent-self off 4.0 %self is no longer expanded (use $fish_pid) -#CHECK: test-require-arg off 4.0 builtin test requires an argument -#CHECK: mark-prompt on 4.0 write OSC 133 prompt markers to the terminal -#CHECK: ignore-terminfo on 4.1 do not look up $TERM in terminfo database -#CHECK: query-term on 4.1 query the TTY to enable extra functionality status test-feature stderr-nocaret echo $status #CHECK: 0