SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Support for platform specific agent? #339

Closed Duncank closed 2 years ago

Duncank commented 2 years ago

I'm authenticating via agent: pageant on Windows, but need to use agent: $SSH_AUTH_SOCK on Mac. Since VSCode doesn't support platform specific settings-sync, I'm constantly changing this manually.

Could this extension support a multi-platform solution, or has anyone thought of a way of doing this already?

Duncank commented 2 years ago

I've looked around in the code for this extension and noticed that the agent is matched against my environment variables if one exists with the same name.

So I've created a workaround by:

Feel free to close this issue as this resolves my use case; of course a native solution would be welcome as well.

SchoofsKelvin commented 2 years ago

That's indeed one way to resolve your issue.

I'll see about supporting a small subset of bash shell parameter expansion to all fields that support environment variables. In that case, ${SSH_AUTH_SOCK:-pageant} would resolve to pageant if $SSH_AUTH_SOCK is empty or unset. Looking at this, you could then technically also add a ternary operation on some $PLATFORM variable, but I might add a simpler way to do that. That or a form of angular expressions where $VAR are const environment variables, I'll see. Not a priority right now though.