Skip to content

ssh kitten: $KITTY_LISTEN_ON is not set in all windows when forwarding remote control #6639

Closed
@dradtke

Description

@dradtke

Describe the bug

When using the new forward_remote_control configuration for the SSH kitten, $KITTY_LISTEN_ON is only set for the first window. If another window is opened in the same SSH session, that variable is not available.

To Reproduce

First, define these configuration files in ~/.config/kitty:

# kitty.conf
allow_remote_control yes
listen_on unix:/tmp/mykitty
map f1 new_window_with_cwd
# ssh.conf
share_connections yes
forward_remote_control yes

Then use the SSH kitten to connect to any remote host, and verify that $KITTY_LISTEN_ON is defined:

$ echo $KITTY_LISTEN_ON
tcp:localhost:46535

Then open a new window with F1, and see if $KITTY_LISTEN_ON is still defined:

$ echo $KITTY_LISTEN_ON
<empty>

When forwarding remote control to the server, I would expect this to be set for all windows opened on that server.

Environment details

kitty 0.30.0 (ef8e3b150c) created by Kovid Goyal
Darwin chlmd-dradtke1 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:53 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6020 arm64
ProductName:		macOS ProductVersion:		13.5.2 BuildVersion:		22G91
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/dradtke/.config/kitty/kitty.conf

Config options different from defaults:
allow_remote_control yes
listen_on            unix:/tmp/mykitty
tab_bar_min_tabs     1
tab_bar_style        powerline
tab_powerline_style  round
Added shortcuts:
	f1 →  new_window_with_cwd

Important environment variables seen by the kitty process:
	PATH                                [...]
	LANG                                en_US.UTF-8
	SHELL                               /bin/zsh
	USER                                dradtke

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions