axonasif / dotsh

A fast dotfiles and system configuration installer optimized for Gitpod and power users
MIT License
30 stars 21 forks source link

How to connect SSH without opening up a workspace? #8

Closed djsnipa1 closed 2 years ago

djsnipa1 commented 2 years ago

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.

axonasif commented 2 years ago

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.

djsnipa1 commented 2 years ago

@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!

axonasif commented 2 years ago

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!