Remote SSH extension - Support parameter when calling command

Hi, I am using the Cursor’s version of remote SSH extension (Anysphere Remote SSH). (Seems like this extension was recently developed to replace the Remote Development Pack from Microsoft).

So, in the MSFT’s Remote SSH extension, I was able to programmatically call “opensshremotes.openEmptyWindow” command with parameter, which helps me skip the step of selecting a host. The “programmatically call command” part is very important, as it enable other extension to be able to launch remote window seamlessly.

Sample code:
vscode.commands.executeCommand('opensshremotes.openEmptyWindow', {host:"myhost"});

Can we also support this in Cursor version, and even make it better than MSFT?

I would love to see support for host name and path, something like:
vscode.commands.executeCommand('opensshremotes.openEmptyWindow', {host:"myhost", path: "/mypath"});

if Cursor can open source this extension, im happy to lend a hand

Hi @Hieu_Khuong, I’d recommend to instead use vscode.newWindow or vscode.openFolder commands with a property remote authority URI. Please see Built-in Commands | Visual Studio Code Extension API.

The vscode.newWindow command supports an (undocumented) remoteAuthority argument. For example:

vscode.commands.executeCommand('vscode.newWindow', { remoteAuthority: "ssh-remote+myhost", reuseWindow: false })

The vscode.openFolder command takes a full URI – e.g.

vscode.commands.executeCommand('vscode.openFolder', vscode.Uri.from({ scheme: 'vscode-remote', authority: "ssh-remote+myhost", path: "/mypath" }), { forceNewWindow: true });

Could you try using these and share whether it works for your use cases? We’d prefer that you don’t call the opensshremotes.openEmptyWindow command directly, as we can’t guarantee backwards compatibility right now.

1 Like

It works, thank you so much