loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.75k stars 328 forks source link

Fix/SSH Conf: Generated ProxyCommand line is missing quotes around path #1001

Closed landoncolburn closed 5 months ago

landoncolburn commented 5 months ago

Fails to connect to DevPod on Windows over SSH since path for ProxyCommand in outputted .ssh/config is grabbed via os.Executable(), the default install location on Windows (C:\Program Files) has a space resulting in line:

  ProxyCommand C:\Program Files\.... ssh --stdio --context default --user devpod workspace-1"

Fixed by wrapping the path in escaped quotations

shanman190 commented 5 months ago

This one would be good for Windows users that don't happen to be using the OpenSSH build that ships internal to Windows 10/11. The internal Microsoft build hides this nuance, but other SSH builds such as the one that ships with Git Bash do not perform any tricks related to the handling of spaces in the path and error out instead.

landoncolburn commented 5 months ago

This one would be good for Windows users that don't happen to be using the OpenSSH build that ships internal to Windows 10/11. The internal Microsoft build hides this nuance, but other SSH builds such as the one that ships with Git Bash do not perform any tricks related to the handling of spaces in the path and error out instead.

Ah that clears some stuff up! I didn't realize that the OpenSSH build handles path resolution differently than Git Bash one, but that makes sense why I was only experiencing this issue on some machines. All versions that I tested support the quoted path though, so this might be a good option even if just for legacy purposes.

shanman190 commented 5 months ago

Yep! The quoted variations are supported universally regardless of OS, so in my opinion this is still a good fix.