This was generated by AI during triage.
Summary
Add a per-RunCommandItem option to choose whether the command runs as a bare process (current behaviour — the executable is launched directly by ConPTY) or inside a PowerShell session (pwsh -Command … / powershell -Command …).
Motivation
- Bare process is correct for compiled tools (
dotnet, cargo, node, custom exes) — no shell overhead, no profile load, predictable argv.
- PowerShell host is needed when the command line uses shell syntax: pipes (
|), redirection (>), variables ($env:), compound statements (;, &&), or calls to cmdlets and PS functions.
- Today every run command is launched bare. Users who want shell features have to manually prefix their command with
pwsh -Command "…", which is awkward and easy to get wrong.
Proposed behaviour
Data model
Add RunMode (enum: Process / PowerShell) to RunCommandItem. Default: Process (backwards-compatible).
Runtime
In SessionRunner / RunInstance, when RunMode == PowerShell:
- Launch
pwsh.exe -NonInteractive -Command <commandLine> (fall back to powershell.exe if pwsh is not found).
- Pass
-ExecutionPolicy Bypass so scripts run without requiring a policy change.
commandLine is passed as-is; the user is responsible for quoting within PS syntax.
Editor UI (SessionRunCommandsDialog)
- Add a small toggle or dropdown column in the run-command table: Process / PowerShell.
- Show a tooltip explaining the difference.
Persistence
RunMode serialises to state.json alongside the other RunCommandItem fields.
Summary
Add a per-
RunCommandItemoption to choose whether the command runs as a bare process (current behaviour — the executable is launched directly by ConPTY) or inside a PowerShell session (pwsh -Command …/powershell -Command …).Motivation
dotnet,cargo,node, custom exes) — no shell overhead, no profile load, predictable argv.|), redirection (>), variables ($env:), compound statements (;,&&), or calls to cmdlets and PS functions.pwsh -Command "…", which is awkward and easy to get wrong.Proposed behaviour
Data model
Add
RunMode(enum:Process/PowerShell) toRunCommandItem. Default:Process(backwards-compatible).Runtime
In
SessionRunner/RunInstance, whenRunMode == PowerShell:pwsh.exe -NonInteractive -Command <commandLine>(fall back topowershell.exeifpwshis not found).-ExecutionPolicy Bypassso scripts run without requiring a policy change.commandLineis passed as-is; the user is responsible for quoting within PS syntax.Editor UI (
SessionRunCommandsDialog)Persistence
RunModeserialises tostate.jsonalongside the otherRunCommandItemfields.