kovidgoyal / kitty

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

macOS: kitty does not work with ssh ProxyCommand #5829

Closed Ozarklake closed 1 year ago

Ozarklake commented 1 year ago

First of all thank you very much for your work

I'm not sure if this is a bug, but I've tested other terminals like iterm2, alacritty and they all work fine, not sure if I'm missing some configuration

Describe the bug When I use socks5 to proxy the ssh protocol I get stuck and unresponsive, the ssh -v message is as follows:

OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/bar/.ssh/config
debug1: /Users/bar/.ssh/config line 131: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: auto-mux: Trying existing master
debug1: Control socket "/tmp/master-root@$remote:22" does not exist
debug1: Executing proxy command: exec nc -X 5 -x $socks5_proxy $remote 22
debug1: Local version string SSH-2.0-OpenSSH_8.6

there is no more..stuck forever

here is my .ssh/config file

Host remote_host
  HostName remote_host 
  User root
  Port 22
  ProxyCommand nc -X 5 -x $socks_proxy %h %p

I tried to capture traffic on the port of the socks5 proxy and noticed that no traffic goes to the proxy when ssh is launched

I also found that if I had established an ssh connection through another terminal, then kitty could reuse the existing connection to log in to the remote server normally

To Reproduce Just try using ProxyCommand to proxy ssh

Environment details

kitty 0.26.5 created by Kovid Goyal
Darwin bars-MacBook-Pro 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:12:57 PDT 2022; root:xnu-8020.240.7~1/RELEASE_X86_64 x86_64
ProductName:    macOS ProductVersion:   12.6.1 BuildVersion:    
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: /usr/local/bin/fish
Loaded config files:
  /Users/bar/.config/kitty/kitty.conf

Config options different from defaults:
copy_on_select          clipboard
cursor_text_color       None
font_family             JetBrainsMonoNL Nerd Font Mono
font_size               18.0
hide_window_decorations 2
shell_integration       frozenset({'disabled'})
tab_bar_edge            1
term                    xterm-256color
kovidgoyal commented 1 year ago

kitty does not log in, ssh does. kitty has no control over what ssh is doing, unless you are using the ssh kitten, which you dont seem to be.

Ozarklake commented 1 year ago

kitty does not log in, ssh does. kitty has no control over what ssh is doing, unless you are using the ssh kitten, which you dont seem to be.

@kovidgoyal Yes, I agree with you

but it's really strange, all things the same, all the other terminals work fine, but not kitty, I really like kitty and would like to be able to cover all my workflows with it.

Can you give me some tips on troubleshooting? For example, how to make sure that kitten is really disabled, or that there are any debug logs or something like that

kovidgoyal commented 1 year ago

The kitten is not used unless you actually run it. As for debug logs, they can only come from ssh which is just -vvv

Ozarklake commented 1 year ago

Alright, after rebooting the whole system, the problem is solved, sorry for the bother