microsoft / microsoft/WinAppVSCE

Refactor: Replace shell-string CLI launching with arg-array pattern

Open
#73 0 comments 0 reactions 1 assignee View on GitHub

@chiaramooney is already working on this.

Since Jul 22, 2026.

enhancement
Dominant language
TypeScript
Stars
13
Forks
3
Avg merge
6d 1h
Merged PRs (30d)
11

Description

Description

runWinappCommand() in extension.ts launches CLI commands via PowerShell string concatenation (terminal.sendText(& ${escapePowerShellArg(cliPath)} ${command})), while other paths in the same file already use the safer spawn(cliPath, args, { shell: false }) pattern.

Impact

  • Inconsistent CLI launch patterns within the same file
  • Shell string approach is harder to audit for injection safety
  • The arg-array pattern is already proven to work in the debug adapter and cert flows

Location

src/extension.ts:58-72 and callers throughout the file

Recommendation

Replace the string-based runWinappCommand() API with a helper that accepts string[] args and launches the CLI with spawn/execFile. If terminal visibility is required, build a terminal-specific adapter from the same arg array.

Found by

PR review skill (alternative-solution dimension) during PR #68 review.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.