Skip to content

fix(supervisor): quote space-containing args in PowerShell Start-Process on Windows#14910

Open
samclark2015 wants to merge 1 commit into
mainfrom
issue-14671
Open

fix(supervisor): quote space-containing args in PowerShell Start-Process on Windows#14910
samclark2015 wants to merge 1 commit into
mainfrom
issue-14671

Conversation

@samclark2015

Copy link
Copy Markdown
Contributor

Fixes #14671

When kernelSupervisor.shutdownTimeout is changed from the default (immediately) on Windows, Positron launches the Kallichore server via PowerShell's Start-Process. PowerShell joins -ArgumentList array elements with spaces when building the cmd.exe command line, so a path like c:\Program Files\...\kcserver.exe is split at the space and cmd.exe tries to run c:\Program — producing the 'c:\Program' is not recognized error.

The fix wraps arguments that contain spaces in double-quotes within the PowerShell array so cmd.exe treats each path as a single token. The batch wrapper is also updated to use %~1 (strips surrounding double-quotes) when assigning the output file path, for defensive correctness.

Release Notes

New Features

  • N/A

Bug Fixes

Validation Steps

@:win @:sessions

This fix is Windows-only and requires an installation in a path containing spaces (e.g. C:\Program Files\Positron\):

  1. Install Positron to a path with spaces
  2. Set kernelSupervisor.shutdownTimeout to when idle (or any non-immediately value)
  3. Restart Positron
  4. Start an R or Python console session — it should start without error

When kernelSupervisor.shutdownTimeout is non-default, Kallichore is
launched via PowerShell's Start-Process on Windows. PowerShell joins
-ArgumentList array elements with spaces when building the cmd.exe
command line, so a path like `c:\Program Files\...\kcserver.exe` is
split at the space, causing `'c:\Program' is not recognized` errors.

Wrap arguments containing spaces in double-quotes within the PowerShell
array so cmd.exe treats them as single tokens. Also change
supervisor-wrapper.bat to use %~1 (which strips surrounding
double-quotes) when assigning the output file path.

Fixes #14671

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:win @:sessions @:console @:interpreter

Why these tags?
Tag Source
@:critical Always runs (required)
@:win PR description
@:sessions PR description
@:console Changed files
@:interpreter Changed files

More on automatic tags from changed files.

readme  valid tags

@samclark2015 samclark2015 requested a review from jmcphers July 16, 2026 15:06
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.

supervisor: failure when kernelSupervisor.shutdownTimeout is changed from default on Windows installations with spaces in the path

1 participant