Files
WODE25500 0389ace563 fix: platform-aware shell quoting + PowerShell call operator (win32) (#246)
dsh's ctx.shell is the platform executor: on win32 the bash stack is disabled
and ctx.shell is a PowerShell executor (powershell.exe 5.1 / pwsh 7), on POSIX
it is bash. The plugin emitted POSIX quotes unconditionally, so every tool
command failed on Windows: 'python' 'args' parses as a string-array expression
and errors with 'missing call operator' (bare quoted words are not a command
in PowerShell).

- q(): platform-aware quoting — PowerShell single-quote escaping (doubled
  quote for an embedded quote) on win32, POSIX (close/reopen) elsewhere.
- quoteArgv(): prepend the `&` call operator on win32 so the quoted argv runs
  as a command; CRLF/lone CR folded to one space, C0 stripped.
- canary/audits: host-shell aware (discover PowerShell 5.1/pwsh 7 like
  dsh-pwsh-local, or bash); injection + control-char audits run against the
  real host shell.

Verified: canary 40/40 (platform-aware quoting), injection 7/7 + control-char
7/7 under real Windows PowerShell, real dsh 0.1.1-rc.2 skillopt_status runs.
POSIX (bash) path unchanged — existing quoting suite still passes.

Co-authored-by: WODE25500 <WODE25500@users.noreply.github.com>
2026-08-23 15:02:46 +08:00
..