Skip to content

Commit 3873fd5

Browse files
committed
Address review comments
1 parent 69081f3 commit 3873fd5

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- Proxy log directory now defaults to the extension's global storage when `coder.proxyLogDirectory`
88
is not set, so SSH connection logs are always captured without manual configuration. Also respects
99
the `CODER_SSH_LOG_DIR` environment variable as a fallback.
10+
- SSH options from `coder config-ssh --ssh-option` are now applied to VS Code connections,
11+
with priority order: VS Code setting > `coder config-ssh` options > deployment config.
1012

1113
## [v1.14.0-pre](https://github.com/coder/vscode-coder/releases/tag/v1.14.0-pre) 2026-03-06
1214

src/remote/remote.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,17 +832,17 @@ export class Remote {
832832
const sshConfig = new SSHConfig(sshConfigFile);
833833
await sshConfig.load();
834834

835-
// Merge SSH config from three sources (lowest to highest priority):
836-
// 1. coder config-ssh --ssh-option flags from the CLI block
837-
// 2. Deployment SSH config from the coderd API
838-
// 3. User's VS Code coder.sshConfig setting
835+
// Merge SSH config from three sources (highest to lowest priority):
836+
// 1. User's VS Code coder.sshConfig setting
837+
// 2. coder config-ssh --ssh-option flags from the CLI block
838+
// 3. Deployment SSH config from the coderd API
839839
const configSshOptions = parseCoderSshOptions(sshConfig.getRaw());
840840
const userConfigSsh = vscode.workspace
841841
.getConfiguration("coder")
842842
.get<string[]>("sshConfig", []);
843843
const userConfig = parseSshConfig(userConfigSsh);
844844
const sshConfigOverrides = mergeSshConfigValues(
845-
mergeSshConfigValues(configSshOptions, deploymentSSHConfig),
845+
mergeSshConfigValues(deploymentSSHConfig, configSshOptions),
846846
userConfig,
847847
);
848848

src/remote/sshSupport.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import * as childProcess from "child_process";
22

3+
// Matches the OpenSSH version number from `ssh -V` output.
4+
// [^,]* prevents greedy matching across comma-separated components
5+
const openSSHVersionRegex = /OpenSSH[^,]*_([\d.]+)/;
6+
37
/** Check if the local SSH installation supports the `SetEnv` directive. */
48
export function sshSupportsSetEnv(): boolean {
59
try {
@@ -17,7 +21,7 @@ export function sshSupportsSetEnv(): boolean {
1721
* Requires OpenSSH 7.8 or later.
1822
*/
1923
export function sshVersionSupportsSetEnv(sshVersionString: string): boolean {
20-
const match = /OpenSSH.*_([\d.]+)[^,]*/.exec(sshVersionString);
24+
const match = openSSHVersionRegex.exec(sshVersionString);
2125
if (match?.[1]) {
2226
const installedVersion = match[1];
2327
const parts = installedVersion.split(".");

test/unit/remote/sshSupport.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const supports = {
1010
"OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022": true,
1111
"OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2": true,
1212
"OpenSSH_9.0p1, LibreSSL 3.3.6": true,
13+
// Version extracted from OpenSSH, not from LibreSSL after the comma
14+
"OpenSSH_7.4p1, LibreSSL_8.1.0": false,
1315
"OpenSSH_7.6p1 Ubuntu-4ubuntu0.7, OpenSSL 1.0.2n 7 Dec 2017": false,
1416
"OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017": false,
1517
};

0 commit comments

Comments
 (0)