Skip to content

[1120] feature: unified-shell-resolution (1/4) - #39

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

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

Conversation

@myk1yt

@myk1yt myk1yt commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Stack Position

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

Description

https://youtube.com/shorts/-cm4pnaoXD0

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

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added inline terminal shell selection with automatic mode, saved profiles, explicit paths, and custom executable browsing.
    • Displays the effective shell and provides feedback for unavailable or invalid selections.
    • Added queued and recovering terminal execution statuses with additional error details.
    • Settings changes can be saved or discarded while remaining synchronized.
  • Localization
    • Added translations for terminal shell settings across supported languages.
  • Tests
    • Added coverage for selection, persistence, validation, fallback behavior, and settings interactions.

Upstream PR: Zoo-Code-Org#1120

@myk1yt myk1yt closed this Aug 12, 2026
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