microsoft / microsoft/vscode-remote-release

Remote-SSH extension checking OS logic bug

Open
#11,117 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Is there an existing issue for this bug?
  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.
Required Troubleshooting Steps
  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar
[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I did not try step 2 of the troubleshooting steps

Remote-SSH Log

Not important here.

Expected Behavior

SSH to Windows should just work

Actual Behavior

SSH timeout

Steps To Reproduce
  1. Prepare a Windows machine with SSH server enabled. uname command exists in $PATH
  2. Connect to Windows using SSH remote plugin
  3. Timeout error
Anything else?

This issue seems related to issue #5555

PS C:\Users\Inndy> which uname
C:/Users/Inndy/scoop/shims/uname.exe

According to plugin source code

async probeServerPlatform() {
	return new Promise(((e, t) => {
		this.execute("uname -rsv", (t => {
			let n;
			return "stdout" in t ? t.stdout.includes("Darwin") ? n = d.Platform.MacOS : t.stdout.toLowerCase().includes("msys") || t.stdout.toLowerCase().includes("windows32") || t.stdout.toLowerCase().includes("cygwin") || t.stdout.toLowerCase().includes("Windows_NT") ? n = d.Platform.Windows : (t.stdout.includes("Linux") || t.stdout.toLowerCase().includes("bsd")) && (n = d.Platform.Linux) : t.stderr && t.stderr.includes("uname") && (n = d.Platform.Windows), !!n && (e(n), !0)
		}))
	}))
}

Replacing t.stdout.toLowerCase().includes("Windows_NT") to t.stdout.toLowerCase().includes("windows_nt") will fix this issue

This patch should be applied to

  • extension/out/extension.js
  • extension/out/resolver.js

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review extension/out/extension.js and extension/out/resolver.js, focusing on the probeServerPlatform logic shown in the issue. Reproduce the Windows SSH connection with uname available in PATH, then verify that the corrected platform detection prevents the SSH timeout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.