Re-enable focus reporting on non-tmux

I can no longer reproduce the issue described in bdd478bbd0 (Disable
focus reporting on non-tmux again for now, 2024-04-18).  Maybe the
TTY handoff changes fixed this.  Let's remove this workaround and
enable focus reporting everywhere.
This commit is contained in:
Johannes Altmanninger
2025-12-01 12:41:02 +01:00
parent 4000503c03
commit 7dd2004da7
2 changed files with 4 additions and 12 deletions

View File

@@ -19,6 +19,8 @@ Improved terminal support
-------------------------
- OSC 133 prompt markers now also mark the prompt end, which improves shell integration with terminals like iTerm2 (:issue:`11837`).
- Operating-system-specific key bindings are now decided based on the :ref:`terminal's host OS <status-terminal-os>`.
- Focus reporting is enabled unconditionally, not just inside tmux.
To use it, define functions that handle the ``fish_focus_in`` or ``fish_focus_out`` :ref:`events <event>`.
- New :ref:`feature flag <featureflags>` ``omit-term-workarounds`` can be turned on to prevent fish from trying to work around incompatible terminals.
For distributors and developers

View File

@@ -64,8 +64,6 @@ pub enum TtyQuirks {
PreCsiMidnightCommander,
// Running in iTerm2 before 3.5.12, which causes issues when using the kitty keyboard protocol.
PreKittyIterm2,
// Whether we are running under tmux.
Tmux,
// Whether we are running under WezTerm.
Wezterm,
}
@@ -80,8 +78,6 @@ fn detect(vars: &dyn Environment, xtversion: &wstr) -> Self {
PreCsiMidnightCommander
} else if get_iterm2_version(xtversion).is_some_and(|v| v < (3, 5, 12)) {
PreKittyIterm2
} else if xtversion.starts_with(L!("tmux ")) {
Tmux
} else if xtversion.starts_with(L!("WezTerm ")) {
Wezterm
} else {
@@ -176,14 +172,8 @@ fn safe_get_supported_protocol(&self) -> ProtocolKind {
// Return the protocols set to enable or disable TTY protocols.
fn get_protocols(self) -> TtyProtocolsSet {
let mut on_chain = vec![DecsetBracketedPaste];
let mut off_chain = vec![DecrstBracketedPaste];
// Enable focus reporting under tmux
if self == TtyQuirks::Tmux {
on_chain.push(DecsetFocusReporting);
off_chain.push(DecrstFocusReporting);
}
let on_chain = vec![DecsetFocusReporting, DecsetBracketedPaste];
let off_chain = vec![DecrstFocusReporting, DecrstBracketedPaste];
let on_chain = || on_chain.clone().into_iter();
let off_chain = || off_chain.clone().into_iter();