diff --git a/modules/home/shell/nushell.nix b/modules/home/shell/nushell.nix index 6026f21..e7e49c5 100644 --- a/modules/home/shell/nushell.nix +++ b/modules/home/shell/nushell.nix @@ -40,8 +40,15 @@ in programs.nushell.enable = lib.mkDefault true; programs.nushell.extraConfig = '' - # Use kitten ssh for proper terminfo on remote hosts - alias ssh = kitten ssh + # Use kitten ssh for proper terminfo on remote hosts. It refuses to run + # outside a kitty window. + def --wrapped ssh [...args] { + if "KITTY_WINDOW_ID" in $env { + ^kitten ssh ...$args + } else { + ^ssh ...$args + } + } # Dotfiles QA validation command def dotfiles-qa [] { diff --git a/modules/home/shell/zsh.nix b/modules/home/shell/zsh.nix index 137c04c..35cfb2d 100644 --- a/modules/home/shell/zsh.nix +++ b/modules/home/shell/zsh.nix @@ -27,8 +27,6 @@ ]; }; - shellAliases.ssh = "kitten ssh"; - profileExtra = '' if [[ -x /opt/homebrew/bin/brew ]]; then eval "$(/opt/homebrew/bin/brew shellenv)" @@ -54,8 +52,14 @@ $path "$HOME/.lmstudio/bin" ) + 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() { local secret_dir="''${XDG_CONFIG_HOME:-$HOME/.config}/secrets/global-env" local secret_file name value