dotsh icon indicating copy to clipboard operation
dotsh copied to clipboard

How to connect SSH without opening up a workspace?

Open djsnipa1 opened this issue 3 years ago • 3 comments

This repo is great! Thank you very much!

How do I start and connect to an SSH session without opening up a workspace like it suggests here.

djsnipa1 avatar Sep 11 '22 18:09 djsnipa1

Hey @djsnipa1, which operating system are you using? If you're on Mac and got iterm2 installed it might work out of the box. The process is that VSCode will start in your browser first, and then spawn a new-tab that will launch the ssh:// protocol.

If you're using kitty, you may want to see https://sw.kovidgoyal.net/kitty/open_actions/#scripting-the-opening-of-files-with-kitty-on-macos to handle the ssh:// protocol, it'll work on both linux and mac.

I have to update the readme, some work left.

axonasif avatar Sep 12 '22 02:09 axonasif

@axonasif I mainly use MacOS: WezTerm or Alacritty and I actually use SSH a lot with my iPhone: blink.sh shell or ShellFish. I know how to connect to ssh:// on all of the listed terminal emulators. I'm wondering how do I get the ssh url to connect to? The ssh command that I currently have to copy and paste from the Gitpod Dashboard.

Thanks again for your time!

djsnipa1 avatar Sep 12 '22 02:09 djsnipa1

Ah, cool! I'm concatenating the ssh address from here with the help of some environment variables: https://github.com/axonasif/dotfiles/blob/d86ce10be9cd08ff2911f09e7eff71449bdd2090/src/utils/vimpod.py#L27 This python script launches the ssh:// URL for me. I start it here: https://github.com/axonasif/dotfiles/blob/d86ce10be9cd08ff2911f09e7eff71449bdd2090/src/config/tmux.sh#L12

In shell it would be

ssh://${GITPOD_WORKSPACE_ID}@${GITPOD_WORKSPACE_ID}.ssh.${GITPOD_WORKSPACE_CLUSTER_HOST}

Hope that helps!

axonasif avatar Sep 12 '22 02:09 axonasif