fix(shell): use kitten ssh only inside a kitty window

This commit is contained in:
Rasyidan Akbar F. 2026-11-02 19:45:57 +07:00
commit d3cded376c
2 changed files with 15 additions and 4 deletions

View file

@ -40,8 +40,15 @@ in
programs.nushell.enable = lib.mkDefault true; programs.nushell.enable = lib.mkDefault true;
programs.nushell.extraConfig = '' programs.nushell.extraConfig = ''
# Use kitten ssh for proper terminfo on remote hosts # Use kitten ssh for proper terminfo on remote hosts. It refuses to run
alias ssh = kitten ssh # outside a kitty window.
def --wrapped ssh [...args] {
if "KITTY_WINDOW_ID" in $env {
^kitten ssh ...$args
} else {
^ssh ...$args
}
}
# Dotfiles QA validation command # Dotfiles QA validation command
def dotfiles-qa [] { def dotfiles-qa [] {

View file

@ -27,8 +27,6 @@
]; ];
}; };
shellAliases.ssh = "kitten ssh";
profileExtra = '' profileExtra = ''
if [[ -x /opt/homebrew/bin/brew ]]; then if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
@ -54,8 +52,14 @@
$path $path
"$HOME/.lmstudio/bin" "$HOME/.lmstudio/bin"
) )
export PATH export PATH
# kitten ssh refuses to run outside a kitty window.
if [ -n "$KITTY_WINDOW_ID" ]; then
alias ssh='kitten ssh'
fi
_load_global_secrets() { _load_global_secrets() {
local secret_dir="''${XDG_CONFIG_HOME:-$HOME/.config}/secrets/global-env" local secret_dir="''${XDG_CONFIG_HOME:-$HOME/.config}/secrets/global-env"
local secret_file name value local secret_file name value