gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.54k stars 3.33k forks source link

ProxyCommand breaks ssh integration #748

Open OGKevin opened 3 weeks ago

OGKevin commented 3 weeks ago

It seems that the work done in #690 did not resolve an issue for me :(

❯ ps -t /dev/pts/0 -o user=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -o pid= -o ppid= -o command=
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
kevin                           1958670 1955432 -zsh
kevin                           2342684       1 /bin/bash /home/kevin/bin/scripts/iap-proxy.sh db-vm-*
kevin                           2342694 2342684 /home/kevin/.nix-profile/google-cloud-sdk/platform/bundledpythonunix/bin/python3 /home/kevin/.nix-profile/google-cloud-sd
kevin                           2350264 1958670 /bin/zsh /home/kevin/bin/scripts/gssh.sh dbtesting
kevin                           2350419 2350264 ssh db-vm-*
kevin                           2350463 2350419 /bin/bash /home/kevin/bin/scripts/iap-proxy.sh db-vm-*
kevin                           2350471 2350463 /home/kevin/.nix-profile/google-cloud-sdk/platform/bundledpythonunix/bin/python3 /home/kevin/.nix-profile/google-cloud-sd

❯ ps -t /dev/pts/7 -o user=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -o pid= -o ppid= -o command=
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
kevin                           2356162 1955432 -zsh
kevin                           2356728 2356162 /bin/zsh /home/kevin/bin/scripts/gssh.sh
kevin                           2356866 2356728 ssh -S /home/kevin/.ssh/*@db-vm-* db-vm-*

In my first pane, where the proxy is setup, the right hostname is not detected. However since im using multiplexing, the next pane when I SSH again and re-use the session, the right hostname is detected.

I'm not sure whats the reason for it not to be detected in the first pane 🤔

Host db-vm-*
  User kevin_*
  ProxyCommand iap-proxy.sh %h
  ProxyUseFdpass no
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null

Host *
  ForwardAgent yes
  AddKeysToAgent no
  Compression no
  ServerAliveInterval 0
  ServerAliveCountMax 3
  HashKnownHosts yes
  UserKnownHostsFile ~/.ssh/known_hosts
  ControlMaster auto
  ControlPath ~/.ssh/%r@%n
  ControlPersist 1h

The * are just redactions.