From f720bc9fab858aebcaee81e9a1c3f78d0996a4d9 Mon Sep 17 00:00:00 2001 From: pagedown Date: Sun, 27 Nov 2022 14:07:19 +0800 Subject: [PATCH] Shell integration: Report cwd on the fish prompt event --- .../fish/vendor_conf.d/kitty-shell-integration.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish index e8ce92cd5..1f39d5059 100644 --- a/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish +++ b/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish @@ -100,7 +100,8 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after # This function name is from fish and will override the builtin one, which is enabled by default for kitty in fish 3.5.0+. # We provide this to ensure that fish 3.2.0 and above will work. # https://github.com/fish-shell/fish-shell/blob/3.2.0/share/functions/__fish_config_interactive.fish#L275 - function __update_cwd_osc --on-variable PWD -d "Report PWD changes to kitty" + # An executed program could change cwd and report the changed cwd, so also report cwd at each new prompt + function __update_cwd_osc --on-variable PWD --on-event fish_prompt -d "Report PWD changes to kitty" status is-command-substitution or echo -en "\e]7;kitty-shell-cwd://$hostname$PWD\a" end