Repository navigation
fix(ssh): double-quote ProxyCommand values for open-remote-ssh - #1156
Merged
Merged
Conversation
EhabY
force-pushed
the
fix/vsc-36-proxycommand-quoting
branch
from
October 15, 2026 07:19
712cd87 to
1d2f34b
Compare
EhabY
force-pushed
the
fix/vsc-36-proxycommand-quoting
branch
6 times, most recently
from
October 15, 2026 09:53
f22f313 to
776af82
Compare
EhabY
force-pushed
the
fix/vsc-36-proxycommand-quoting
branch
from
October 15, 2026 10:00
776af82 to
9e48529
Compare
Lisa-Fiander
self-requested a review
October 15, 2026 10:10
EhabY
force-pushed
the
fix/vsc-36-proxycommand-quoting
branch
from
October 15, 2026 10:10
9e48529 to
ab11669
Compare
Lisa-Fiander
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1153
What's fixed
1.17.0 broke SSH connections from editors that use the open source Remote - SSH extension (
open-remote-ssh), such as Positron and VSCodium. That extension splits theProxyCommanditself instead of running it through a shell, so it parsed our line differently than OpenSSH does:--urland--global-configwere single-quoted. Positron passed the quotes to the CLI literally ('https://…'), and the CLI exited ("Premature close").--token=:ssh-config@5treats an unquoted=as a separator, so--token= --global-configreached the CLI as--token=--global-config.coder.headerCommandnever worked withopen-remote-sshbecause it was always single-quoted."was split into several arguments.escapeShellArgwrote"as"", but the Go CLI parses\".How
escapeProxyCommandArguses double quotes unless the value contains$, a backtick,\,%or a line break, which aren't literal inside double quotes. Those values keep the 1.17.0 single quotes, so nothing becomes less literal. The deployment URL can never contain these characters (validateDeploymentUrl).escapeCommandArgquotes a leading, trailing or doubled=.escapeShellArgwrites\"and doubles the backslashes before it (the standard Windows argument rule).Tests pin the exact quoting. One native test runs a real
ProxyCommandthroughsh -con Unix and the Windows argument parser on Windows, so CI checks each platform. I also checked lines by hand against real OpenSSH (sh/bash/dash), Positron's@jeanp413/ssh-config@4.3.1, and upstream'sssh-config@5.3.0+splitProxyCommand.Not fixed here (upstream)
\from Windows paths (C:UsersJohn Doe…). Already fixed upstream in fix(windows): skip backslash escape in ProxyCommand tokenizer on Windows jeanp413/open-remote-ssh#342, which ships in 0.4.1.$, a backtick,\or%still needs an extension that runsssh(for example Microsoft Remote-SSH).Generated by Coder Agents on behalf of @EhabY.