From 516b8da30227a60bbf75d60020e2cf6b8299f3ae Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sat, 10 Jun 2023 07:25:20 +0200 Subject: [PATCH] Allow disabling focus reporting --- share/functions/__fish_config_interactive.fish | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 97557a6a8..f7f9e44e6 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -218,10 +218,14 @@ end" >$__fish_config_dir/config.fish # - Any listeners (like the vi-cursor) if set -q TMUX and not set -q FISH_UNIT_TESTS_RUNNING - function __fish_enable_focus --on-event fish_postexec + # Allow overriding these - we're called very late, + # and so it's otherwise awkward to disable focus reporting again. + not functions -q __fish_enable_focus + and function __fish_enable_focus --on-event fish_postexec echo -n \e\[\?1004h end - function __fish_disable_focus --on-event fish_preexec + not functions -q __fish_disable_focus + and function __fish_disable_focus --on-event fish_preexec echo -n \e\[\?1004l end # Note: Don't call this initially because, even though we're in a fish_prompt event,