fix: scope ssh shell niceties to cmux ssh

This commit is contained in:
Lawrence Chen 2026-02-20 21:51:35 -08:00
parent fb35f3bc39
commit bbd8b2b311
4 changed files with 12 additions and 89 deletions

View file

@ -29,19 +29,6 @@ fi
[[ ! -r "$_cmux_file" ]] || builtin source -- "$_cmux_file"
} always {
if [[ -o interactive ]]; then
# Opt into Ghostty's SSH shell niceties by default so plain `ssh ...`
# gets TERM compatibility + remote terminfo setup.
if [[ -n "${GHOSTTY_SHELL_FEATURES:-}" ]]; then
builtin typeset _cmux_features=",$GHOSTTY_SHELL_FEATURES,"
if [[ "$_cmux_features" != *",ssh-env,"* ]]; then
builtin export GHOSTTY_SHELL_FEATURES="${GHOSTTY_SHELL_FEATURES},ssh-env"
_cmux_features=",$GHOSTTY_SHELL_FEATURES,"
fi
if [[ "$_cmux_features" != *",ssh-terminfo,"* ]]; then
builtin export GHOSTTY_SHELL_FEATURES="${GHOSTTY_SHELL_FEATURES},ssh-terminfo"
fi
fi
# We overwrote GhosttyKit's injected ZDOTDIR, so manually load Ghostty's
# zsh integration if available.
if [[ -n "${GHOSTTY_RESOURCES_DIR:-}" ]]; then
@ -56,5 +43,5 @@ fi
fi
fi
builtin unset _cmux_file _cmux_features _cmux_ghostty _cmux_integ
builtin unset _cmux_file _cmux_ghostty _cmux_integ
}