ssh kitten: Fix kitten not being on PATH when sshing into Debian systems

Fixes #7160
This commit is contained in:
Kovid Goyal
2025-01-02 19:46:50 +05:30
parent dd249df5eb
commit 9d027e4fbd
6 changed files with 28 additions and 2 deletions

View File

@@ -89,6 +89,13 @@ _ksi_deferred_init() {
opt=(${(s: :)KITTY_SHELL_INTEGRATION})
builtin unset KITTY_SHELL_INTEGRATION
if [[ -n "$SSH_KITTEN_KITTY_DIR" ]]; then
if [[ ! "$PATH" =~ (^|:)${SSH_KITTEN_KITTY_DIR}(:|$) ]] && [[ -z "$(builtin command -v kitten)" ]]; then
builtin export PATH="${PATH}:${SSH_KITTEN_KITTY_DIR}"
fi
builtin unset SSH_KITTEN_KITTY_DIR
fi
# The directory where kitty-integration is located: /.../shell-integration/zsh.
builtin local self_dir="${functions_source[_ksi_deferred_init]:A:h}"
# The directory with _kitty. We store it in a directory of its own rather than