Skip to content

feature: unified-shell-resolution (1/4) - #22

Closed
myk1yt wants to merge 13 commits into
mainfrom
pr/b04-shell-contracts-v2
Closed

feature: unified-shell-resolution (1/4)#22
myk1yt wants to merge 13 commits into
mainfrom
pr/b04-shell-contracts-v2

Conversation

@myk1yt

@myk1yt myk1yt commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Stack Position

  • Feature Branch: feature/unified-shell-resolution
  • Stage: 1/4
  • Depends on: None

Description

Full Feature Description

  • Feature Branch: feature/unified-shell-resolution
  • Feature Name: Unified Shell Resolution
  • Purpose: Resolves the problem where shell selection, profile interpretation, argument assembly, and terminal reuse differ across command execution paths. Unifies the priority among user-configured shell, VS Code default profile, OS default, and safe fallback into a single typed resolution pipeline. This ensures that the same user settings produce a predictable execution environment across Windows Command Prompt, PowerShell, WSL, and macOS/Linux POSIX shells, reducing cases where the entire task fails in unclear ways due to misconfiguration.
  • Full Change Description: B04 defines the shared shell settings types and the UI using local cached state before saving. B05 resolves settings and platform information into an executable, shell family, source, and argument array, preserving argument boundaries instead of string concatenation. B06 manages command queue, terminal lifecycle, registry, reuse, trace, cancellation, and disposal. B07 connects the resolver and lifecycle to the task, command tool, extension API, and webview message paths.
  • Impact Scope: Affects the shared contracts terminal.ts, global-settings.ts, vscode-extension-host.ts, the settings UI TerminalSettings.tsx and SettingsView.tsx, the backend terminal layer src/integrations/terminal, and the task/tool/API wiring Task.ts, ExecuteCommandTool.ts, api.ts.
  • Errors and Edge Cases: If an explicit user override is invalid, returns a typed rejectable error. If an automatic candidate is invalid, proceeds to the next candidate. Timeout, user cancellation, non-zero exit, and terminal disposal are kept as distinct outcomes. Shell path and command arguments are never combined into a single unescaped string. Inputs in SettingsView.tsx bind to cachedState, not live extension state.
  • Testing Method: Run B04's contract and settings component tests, B05's Windows/POSIX/WSL resolution and invocation tests, B06's queue/reuse/cancellation/disposal tests, B07's task/tool/message tests and terminal-profile.test.ts. Manually run the same command in default, PowerShell, Command Prompt, and where available WSL/POSIX profiles, comparing the selected executable, output, exit code, cancellation, and cleanup.

Why Split Into 17 PRs

Instead of submitting this feature as a single unified PR, it was split into individual PRs because as code size grows, safely reviewing a PR becomes very difficult. The feature was broken into mutually exclusive individual PRs so that each can be reviewed independently.

What This PR Specifically Changes

Adds typed shell selection/profile/default contracts, backward-compatible serialization, settings UI and locale. The UI uses SettingsView.tsx's cachedState and does not change command execution.

Included Files

  • packages/types/src/terminal.ts
  • packages/types/src/global-settings.ts
  • packages/types/src/vscode-extension-host.ts
  • webview-ui/src/components/settings/TerminalSettings.tsx
  • webview-ui/src/components/settings/SettingsView.tsx
  • Related locale and direct tests

Exclusion Scope

  • Command execution changes
  • Resolver, lifecycle, scheduler, extension wiring
  • Settings implementation that directly binds to live extension state
  • All items in the common removal rules

@myk1yt myk1yt changed the title B04: Shell Contracts v2 feature: unified-shell-resolution (1/4) Aug 3, 2026
@myk1yt
myk1yt force-pushed the pr/b04-shell-contracts-v2 branch from 0c99d63 to d59cdba Compare August 4, 2026 11:31
Zoo (VP) and others added 5 commits August 5, 2026 05:28
@myk1yt
myk1yt force-pushed the pr/b04-shell-contracts-v2 branch from f1ca0e8 to 952963b Compare August 7, 2026 04:11
@myk1yt myk1yt closed this Aug 7, 2026
@myk1yt
myk1yt deleted the pr/b04-shell-contracts-v2 branch August 7, 2026 13:05
@myk1yt
myk1yt restored the pr/b04-shell-contracts-v2 branch August 7, 2026 13:27
@myk1yt myk1yt reopened this Aug 8, 2026
@myk1yt

myk1yt commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Closing to recreate with main as target base branch. This PR had stale base branch references after fork sync.

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.

1 participant