Skip to content

fix: read SSH settings from the active extension's section - #1060

Merged
EhabY merged 1 commit into
mainfrom
fix/remote-ssh-setting-namespaces
Aug 3, 2026
Merged

fix: read SSH settings from the active extension's section#1060
EhabY merged 1 commit into
mainfrom
fix/remote-ssh-setting-namespaces

Conversation

@EhabY

@EhabY EhabY commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

getSshConfigPath() read remote.SSH.configFile unconditionally. Two of the five Remote-SSH implementations we support forked open-remote-ssh and renamed the entire settings section, so that key does not exist for them:

Extension Section it reads
ms-vscode-remote.remote-ssh remote.SSH
anysphere.remote-ssh (Cursor) remote.SSH
jeanp413.open-remote-ssh remote.SSH
codeium.windsurf-remote-openssh (Windsurf/Devin) remote.devinSSH, legacy remote.windsurfSSH
google.antigravity-remote-openssh remote.antigravitySSH

Verified by reading the installed bundles: Antigravity resolves getConfiguration("remote.antigravitySSH").get("configFile") and contributes only remote.antigravitySSH.*; Windsurf uses a dual-read helper over remote.devinSSH and remote.windsurfSSH, preferring the former. Neither references remote.SSH anywhere.

So on Antigravity or Windsurf with a custom SSH config file configured, we wrote the workspace host block into ~/.ssh/config while the extension launched ssh -F <their file> — host not found, connection fails.

Change

SETTING_SECTIONS maps each known extension to the sections it consults, and getRemoteSshSetting() returns the first non-empty value across them. Unknown/absent extension falls back to remote.SSH.

Windsurf/Devin and Antigravity forked open-remote-ssh and renamed the
whole `remote.SSH` configuration section, so reading
`remote.SSH.configFile` silently missed a custom config file on those
editors and the workspace host was written to `~/.ssh/config`, which
they never read.

Map each known Remote-SSH extension to the sections it consults and read
the first non-empty value from those. Windsurf reads both
`remote.devinSSH` and `remote.windsurfSSH`, preferring the new name.
@matifali

matifali commented Aug 3, 2026

Copy link
Copy Markdown
Member

@EhabY should we also start respecting ting devin:// in our Frontend code on coder/coder and https://registry.coder.com/modules/coder/windsurf

It is not part of this, but just came to mind while reading it.

@EhabY

EhabY commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

Oh yes we probably should, the only difference now is that the app name has been changed from Windsurf to Devin, so windsurf -> devin everywhere

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@EhabY
EhabY merged commit 64c44cb into main Aug 3, 2026
11 checks passed
@EhabY
EhabY deleted the fix/remote-ssh-setting-namespaces branch August 3, 2026 22:50
EhabY added a commit that referenced this pull request Aug 3, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
EhabY added a commit that referenced this pull request Aug 4, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
EhabY added a commit that referenced this pull request Aug 5, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
EhabY added a commit that referenced this pull request Aug 6, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
EhabY added a commit that referenced this pull request Aug 11, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
EhabY added a commit that referenced this pull request Aug 11, 2026
Antigravity and Windsurf/Devin renamed the setting to
remote.antigravitySSH.configFile and remote.devinSSH.configFile, then
spawn ssh without -F, so ssh reads ~/.ssh/config no matter what any of
them say. The setting only feeds their own host tree.

Honoring it, or a stale remote.SSH.configFile synced in from another
editor, writes the workspace host to a file the connection never reads.
Ignore it on those two and keep reading remote.SSH.configFile elsewhere:
Microsoft's extension and Cursor's fork pass it to ssh with -F, and
VSCodium's fork parses the file itself instead of running ssh.

This drops the per-extension section map from #1060: the three
extensions that do connect through the setting all read remote.SSH.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants