kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.8k stars 961 forks source link

SSH Kitten ignores config file #7664

Closed JayBraker closed 1 month ago

JayBraker commented 1 month ago

Describe the bug I setup a minimal kitty config in $HOME/.config/kitty/kitty.conf which works as expected. However I want to specify a custom login shell for a specific remote host so I followed https://sw.kovidgoyal.net/kitty/kittens/ssh/#login-shell-environment and created the $HOME/.config/kitty/ssh.conf accordingly - it contains 2 lines

hostname hostname.example.com
login_shell zsh

However even after I started a fresh kitty instance, the ssh.conf seems to be ignored completely.

When I specify the loginshell inline it works as expected kitten ssh hostname.example.com --kitten login_shell=zsh

To Reproduce Steps to reproduce the behavior:

  1. Install kitty 0.35.2
  2. Ensure kitten is also version 0.35.2
  3. Ensure $HOME/.config/kitty is recognized by kitty
  4. Create $HOME/.config/kitty/ssh.conf
  5. Observe the ssh-kitten config not being used

Environment details

kitty 0.35.2 created by Kovid Goyal
Linux arch 6.6.40-1-lts #1 SMP PREEMPT_DYNAMIC Mon, 15 Jul 2024 09:23:08 +0000 x86_64
Arch Linux 6.6.40-1-lts (/dev/tty)

Running under: Wayland (GNOME Shell 46.3.1) missing: layer_shell
OpenGL: '4.6 (Core Profile) Mesa 24.1.4-arch1.2' Detected version: 4.6
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib/kitty
  extensions dir: /usr/lib/kitty/kitty
  system shell: /usr/bin/zsh
Loaded config files:
  /home/josha/.config/kitty/kitty.conf

Config options different from defaults:
active_border_color       None
active_tab_title_template {fmt.fg._fff}{title}
background_opacity        0.76
hide_window_decorations   1
tab_bar_edge              1
tab_bar_style             powerline
tab_powerline_style       slanted
tab_title_template        {fmt.fg.c2c2c2}{title}
window_border_width       (0, 'pt')
window_padding_width      FloatEdges(left=2.0, top=2.0, right=2.0, bottom=2.0)
Added shortcuts:
    f1 →  detach_tab ask
Colors:
    active_tab_background     #8631b4   
    active_tab_foreground     #ffffff   
    inactive_tab_background   #8631b4   
    inactive_tab_foreground   #c2c2c2   

Important environment variables seen by the kitty process:
    PATH                                /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/share/dotnet:/home/josha/.dotnet/tools:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin
    LANG                                en_US.UTF-8
    SHELL                               /usr/bin/zsh
    DISPLAY                             :0
    WAYLAND_DISPLAY                     wayland-0
    USER                                josha
    LC_MEASUREMENT                      de_DE.UTF-8
    LC_MONETARY                         de_DE.UTF-8
    LC_NUMERIC                          de_DE.UTF-8
    LC_PAPER                            de_DE.UTF-8
    LC_TIME                             de_DE.UTF-8
    XDG_DATA_DIRS                       /home/josha/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/
    XDG_RUNTIME_DIR                     /run/user/1000
    LC_ADDRESS                          de_DE.UTF-8
    LC_TELEPHONE                        de_DE.UTF-8
    XDG_CACHE_HOME                      /home/josha/.cache
    XDG_CONFIG_HOME                     /home/josha/.config
    XDG_CURRENT_DESKTOP                 GNOME
    XDG_DATA_HOME                       /home/josha/.local/share
    XDG_MENU_PREFIX                     gnome-
    XDG_SESSION_CLASS                   user
    XDG_SESSION_DESKTOP                 gnome
    XDG_SESSION_TYPE                    wayland

Additional context kitty --config NONE did not change the observed behavior

kovidgoyal commented 1 month ago

Does not reproduce for me with those steps:

echo "hostname ox\nlogin_shell bash\nenv FOO=BAR" > ~/.config/kitty/ssh.conf && kitty kitten ssh ox

Logs in with bash instead of the default zsh, as expected. And the env var FOO set to BAR