Description
For upcoming SSH integration related features, kitty started to support parsing the current working directory from OSC 7.
In addition to the file:// escaped URL format, it also supports kitty-shell-cwd://$hostname$PWD, which does not require URL escaping.
To allow fish 3.2.0+ to report CWD as well, the following code was added to kitty's shell integration. Please feel free to point out if there is anything wrong with it.
# Enable CWD reporting if not contains "no-cwd" $_ksi # This function name is from fish and will override the builtin one if fish enabled this feature by default. # 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" status is-command-substitution or echo -en "\e]7;kitty-shell-cwd://$hostname$PWD\a" end __update_cwd_osc end
Are we allowed to add kitty cwd format? Maybe that would improve performance.
TODOs:
- Changes to fish usage are reflected in user documentation/manpages.
- Tests have been added for regressions fixed
- User-visible changes noted in CHANGELOG.rst