kovidgoyal / kitty

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

Kitty launch --cwd=current does not work when kitten ssh uses the cwd= parameter #7688

Closed longsleep closed 2 months ago

longsleep commented 2 months ago

When using kitten ssh with --kitten cwd=folder (for example kitten ssh myserver --kitten cwd=folder) the ssh session gets openend and the shell is correctly in the specified folder. When now using "launch" with its --cwd=current parameter via a mapped key (for example map f1 launch --cwd=current), the current directory is not passed over to the new window. This works fine when kitten ssh is not using the cwd= parameter.

Environment details

kitty 0.35.2 (ad328bfeaa) created by Kovid Goyal
Linux mose4 6.9.10-zabbly+ #ubuntu22.04 SMP PREEMPT_DYNAMIC Fri Jul 19 22:40:39 UTC 2024 x86_64
Pop!_OS 22.04 LTS mose4 /dev/tty

DISTRIB_ID=Pop
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Pop!_OS 22.04 LTS"
Running under: Wayland (GNOME Shell 42.9) missing: preferred_scale
OpenGL: '4.6 (Core Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319' Detected version: 4.6
Frozen: True
Paths:
  kitty: /home/longsleep/.local/kitty.app/bin/kitty
  base dir: /home/longsleep/.local/kitty.app/lib/kitty
  extensions dir: /home/longsleep/.local/kitty.app/lib/kitty-extensions
  system shell: /usr/bin/zsh
Loaded config files:
  /home/longsleep/.config/kitty/kitty.conf

Config options different from defaults:
enabled_layouts         ['splits:split_axis=horizontal']
font_family             Fira Mono for Powerline
initial_window_height   (460, 'px')
initial_window_width    (720, 'px')
remember_window_size    False
tab_bar_min_tabs        1
tab_bar_style           slant
Added shortcuts:
    ctrl+b > - →  launch --location=hsplit --allow-remote-control kitty +kitten search.py @active-kitty-window-id, launch --location=vsplit --cwd=current, launch --location=hsplit --cwd=current
    kitty_mod+/ →  launch --location=hsplit --allow-remote-control kitty +kitten search.py @active-kitty-window-id
Colors:
    active_border_color     #75715e   
    active_tab_background   #75715e   
    active_tab_foreground   #272822   
    background              #272822   
    color0                  #272822   
    color1                  #f92672   
    color10                 #a6e22e   
    color11                 #e6db74   
    color12                 #66d9ef   
    color13                 #fd971f   
    color14                 #ae81ff   
    color15                 #f8f8f2   
    color2                  #a6e22e   
    color3                  #e6db74   
    color4                  #66d9ef   
    color5                  #fd971f   
    color6                  #ae81ff   
    color7                  #f8f8f2   
    color8                  #75715e   
    color9                  #f92672   
    cursor                  #f8f8f2   
    foreground              #f8f8f2   
    inactive_border_color   #75715e   
    inactive_tab_background #272822   
    inactive_tab_foreground #75715e   
    selection_background    #f8f8f2   
    selection_foreground    #272822   
    url_color               #f8f8f2   
    wayland_titlebar_color  background

Important environment variables seen by the kitty process:
    PATH                                /home/longsleep/.local/kitty.app/bin:/home/longsleep/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
    LANG                                en_US.UTF-8
    SHELL                               /usr/bin/zsh
    DISPLAY                             :0
    WAYLAND_DISPLAY                     wayland-0
    USER                                longsleep
    LC_TIME                             de_DE.UTF-8
    XDG_SESSION_TYPE                    wayland
    LC_MONETARY                         de_DE.UTF-8
    XDG_SESSION_CLASS                   user
    LC_ADDRESS                          de_DE.UTF-8
    XDG_RUNTIME_DIR                     /run/user/1000
    XDG_MENU_PREFIX                     gnome-
    LC_TELEPHONE                        de_DE.UTF-8
    XDG_CURRENT_DESKTOP                 pop:GNOME
    XDG_SESSION_DESKTOP                 pop-wayland
    LC_NAME                             de_DE.UTF-8
    LC_MEASUREMENT                      de_DE.UTF-8
    LC_IDENTIFICATION                   de_DE.UTF-8
    XDG_DATA_DIRS                       /home/longsleep/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
    LC_NUMERIC                          de_DE.UTF-8
    LC_PAPER                            de_DE.UTF-8

I couldn't find anything similar reported other than https://github.com/kovidgoyal/kitty/discussions/5892 which is not the same.

kovidgoyal commented 2 months ago

I cannot replicate, steps I tried:

1) Start kitty as

kitty --config=NONE -o 'map f1 launch --cwd=current' kitten ssh --kitten cwd=/tmp localhost

2) change directory from /tmp to ~

3) press f1

4) New window is opened in ~, as expected

longsleep commented 2 months ago

I cannot replicate, steps I tried:

  1. New window is opened in ~, as expected

@kovidgoyal Thanks for checking this out! Looking at your stes, I don't think this is the right test, because ~ is the default location and hence it is not possible to tell if it actually "works" the default behavior and the remote location are the same.

Instead, to reproduce simply skip your step 2. Then, new window must open in /tmp of ssh localhost, but instead it opens in ~ of ssh localhost.

So please kindly reopen this.