diff --git a/home-manager/commands/commands.nix b/home-manager/commands/commands.nix index ab71553..abd33ac 100644 --- a/home-manager/commands/commands.nix +++ b/home-manager/commands/commands.nix @@ -97,6 +97,7 @@ in claude-code caligula ocamlPackages.utop + opencode openconnect yubikey-manager ]) diff --git a/home-manager/commands/fastfetch/fastfetch.nix b/home-manager/commands/fastfetch/fastfetch.nix index 6945a66..ccf704f 100644 --- a/home-manager/commands/fastfetch/fastfetch.nix +++ b/home-manager/commands/fastfetch/fastfetch.nix @@ -25,24 +25,29 @@ let # Terminal detection logic # For SSH sessions, default to chafa since we can't guarantee terminal capabilities - # For local sessions, check TERM and TERM_PROGRAM environment variables - terminalType = - if isSSH then - "chafa" # Safe default for remote connections +terminalType = + if isSSH then + # Enhanced SSH detection: try to detect Kitty, fallback to chafa + let + term = builtins.getEnv "TERM"; + termProgram = builtins.getEnv "TERM_PROGRAM"; + kittyWindowId = builtins.getEnv "KITTY_WINDOW_ID"; + kittyPid = builtins.getEnv "KITTY_PID"; + + # Kitty detection over SSH + isKittyOverSSH = kittyWindowId != "" || + kittyPid != "" || + termProgram == "kitty" || + lib.hasInfix "kitty" term || + lib.hasInfix "xterm-kitty" term; + in + if isKittyOverSSH then + "kitty" else - let - term = builtins.getEnv "TERM"; - termProgram = builtins.getEnv "TERM_PROGRAM"; - in - if termProgram == "kitty" || lib.hasInfix "kitty" term then - "kitty" - else if termProgram == "WezTerm" || lib.hasInfix "wezterm" term then - "wezterm" - else if termProgram == "ghostty" then - "kitty" # Ghostty doesn't have kitty protocol support - else - "chafa"; # Default fallback + "chafa" + else + "kitty"; in {