Allow remote resolver terminals before workspace trust - #329228
Draft
joshspicer wants to merge 2 commits into
Draft
Allow remote resolver terminals before workspace trust#329228joshspicer wants to merge 2 commits into
joshspicer wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 907702b2-eba4-43b0-9fca-eb56c92d0443
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a proposal-gated terminal option allowing Remote-SSH bootstrap terminals to start before workspace trust resolves without changing workspace trust itself.
Changes:
- Defines and validates
isRemoteResolverTerminal. - Propagates and consumes the marker before process creation.
- Tests proposal enforcement, trust bypass, and ordinary terminal behavior.
Show a summary per file
| File | Description |
|---|---|
src/vscode-dts/vscode.proposed.terminalRemoteResolver.d.ts |
Defines the proposed option. |
src/vs/platform/extensions/common/extensionsApiProposals.ts |
Registers the proposal. |
src/vs/platform/terminal/common/terminal.ts |
Adds the internal launch marker. |
src/vs/workbench/api/common/extHost.api.impl.ts |
Validates proposal access. |
src/vs/workbench/api/common/extHostTerminalService.ts |
Adds the marker to launch DTOs. |
src/vs/workbench/api/common/extHost.protocol.ts |
Extends the terminal protocol. |
src/vs/workbench/api/browser/mainThreadTerminalService.ts |
Transfers the marker into launch configuration. |
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts |
Consumes the marker and bypasses only the trust request. |
src/vs/workbench/api/test/browser/extHost.api.impl.test.ts |
Tests proposal validation. |
src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts |
Tests trust and process-creation behavior. |
Review details
- Files reviewed: 9/10 changed files
- Comments generated: 0
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 907702b2-eba4-43b0-9fca-eb56c92d0443
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.
Fixes #328475.
Related duplicate: microsoft/vscode-remote-release#11613.
Summary
Add a narrowly scoped proposed
TerminalOptions.isRemoteResolverTerminaloption for the local, hidden terminal a remote authority resolver uses to bootstrap its connection. The option is validated against the calling extension'sterminalRemoteResolverproposal before it crosses the extension-host RPC boundary.The main thread converts the validated DTO boolean into an internal unique-symbol marker, so command arguments, serialized launch configurations, and revived terminals cannot forge or persist it.
TerminalInstanceconsumes the marker and skips only the workspace-trust request for terminal process creation when all resolver-bootstrap constraints hold:file:URI cwd;The workspace is not marked trusted and all other Restricted Mode behavior remains unchanged. Ordinary local terminals in untrusted remote workspaces continue to wait for workspace trust, preserving #316312. Trust denial now returns before backend process creation.
The terminal service also recognizes a local file URI supplied inside an API launch config before waiting for remote terminal profiles. Without this, the resolver bootstrap terminal could stall before reaching the trust gate.
Why not the alternatives?
remote.SSH.useLocalServerdefault changes the connection architecture and compatibility surface rather than fixing the hidden-terminal path.Security
The bypass is proposal-only and explicitly named for remote resolver bootstrap terminals. It authorizes only creation of the constrained local terminal process and is temporally limited to remote workspace-trust initialization.
Workspace-scoped terminal profile, cwd, automation profile, and
terminal.integrated.env.*settings are restricted settings, so untrusted workspace values are not applied to this path. Proposal-enabled resolver extensions remain responsible for ensuring the bootstrap executable, arguments, environment, and local cwd are not derived from untrusted workspace content.Extension adoption
Remote-SSH adoption draft: microsoft/vscode-remote-ssh#660.
An adopting extension should:
terminalRemoteResolvertoenabledApiProposals.isRemoteResolverTerminalonly on the resolver bootstrap terminal inssh-command-runner.ts.{ "enabledApiProposals": [ "resolvers", "terminalRemoteResolver" ] }Validation
./scripts/test.sh --run src/vs/workbench/api/test/browser/extHost.api.impl.test.ts --run src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts --run src/vs/workbench/contrib/terminal/test/browser/terminalService.test.tsnpm run typecheck-client