Feature
The agent pane and autofix should be context-aware of the active session''s shell — in particular, recognize when the current pane is running WSL/bash (not PowerShell) — so that:
- Agent pane chat answers and suggested commands use the right shell syntax (
ls -a vs Get-ChildItem, forward-slash paths, etc.).
- Autofix suggests a fix appropriate to the failing pane''s shell.
Problem
Previously the shell was inferred only from the pane''s host process pid (pwsh.exe / wsl.exe …) on the wta side. That has a blind spot for nested shells: in pwsh → wsl → bash, the host process stays wsl.exe/pwsh.exe, so the agent could not tell the prompt is now bash and would suggest PowerShell. This is the root cause of the WSL-gives-PowerShell behavior in #200.
Implementation
Shells self-report their identity every prompt via OSC 9001;ShellType;<name>;<version> (e.g. pwsh, bash, wsl:Ubuntu). This flows through adaptDispatch → Terminal::SetShellType → ControlCore → PaneInfo.Shell (protocol JSON), and wta now prefers this reported shell over the pid-based lookup (kept as a fallback). The agent''s terminal context (build_terminal_context_json) carries it as the shell field consumed by the planner/autofix.
Status
✅ Implemented in PR #345.
Related
Feature
The agent pane and autofix should be context-aware of the active session''s shell — in particular, recognize when the current pane is running WSL/bash (not PowerShell) — so that:
ls -avsGet-ChildItem, forward-slash paths, etc.).Problem
Previously the shell was inferred only from the pane''s host process pid (
pwsh.exe/wsl.exe…) on the wta side. That has a blind spot for nested shells: inpwsh→wsl→ bash, the host process stayswsl.exe/pwsh.exe, so the agent could not tell the prompt is now bash and would suggest PowerShell. This is the root cause of the WSL-gives-PowerShell behavior in #200.Implementation
Shells self-report their identity every prompt via
OSC 9001;ShellType;<name>;<version>(e.g.pwsh,bash,wsl:Ubuntu). This flows throughadaptDispatch→Terminal::SetShellType→ControlCore→PaneInfo.Shell(protocol JSON), and wta now prefers this reportedshellover the pid-based lookup (kept as a fallback). The agent''s terminal context (build_terminal_context_json) carries it as theshellfield consumed by the planner/autofix.Status
✅ Implemented in PR #345.
Related