Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot launch a remote Windows powershell terminal #255

Open
djndl1 opened this issue Apr 13, 2021 · 1 comment
Open

Cannot launch a remote Windows powershell terminal #255

djndl1 opened this issue Apr 13, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@djndl1
Copy link

djndl1 commented Apr 13, 2021

I have a Windows 2016 Server running the OpenSSH Server ported by Microsoft. vscode-sshfs connection is fine and mounting is usable but the terminal won't launch. I tried setting Terminal Command to the Windows path to PowerShell.exe but it didn't work. Is this supported or am I just doing the impossible?

@SchoofsKelvin
Copy link
Owner

I'll have to look a bit more into it, but currently it seems like Windows executes:

"c:\\windows\\system32\\cmd.exe" /c "cd /; powershell"

which fails because Windows command prompt doesn't accept ; as a command splitter.

I'm not sure whether changing the extension to "split" using && (which command prompt supports) instead of ; would break (some) Unix operating systems, so I'll have to look into that.

For a temporary fix, I pushed a small fix (d20d4be) that fixes this, but you have to add this flags to your config in your VS Code User Settings (settings.json):

    "sshfs.configs": [
        {
            "name": "your-server",
            "flags": ["WINDOWS_COMMAND_SEPARATOR"],
            "terminalCommand": "powershell"
        }
    ],

Mind that you also need to include the "terminalCommand": "powershell", since the extension otherwise tries to use $SHELL which apparently isn't a thing here either. The fix is available in v1.20.1 of the extension, just released.

@SchoofsKelvin SchoofsKelvin added the bug Something isn't working label Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants