mux appears to fail detecting an installed devcontainer CLI on Windows.
At src/node/runtime/devcontainerCli.ts (around line 181), the code runs:
spawn("devcontainer", ["--version"], { ... })
Source: https://github.com/coder/mux/blob/main/src/node/runtime/devcontainerCli.ts#L181
On Windows, devcontainer is often resolved through extensions such as .bat/.cmd/.ps1. With plain child_process.spawn(...) (without shell resolution or a cross-platform wrapper), command lookup can fail even when devcontainer is installed and available in PATH.
Steps to reproduce
- Use Windows (PowerShell or CMD), with
devcontainer CLI correctly installed and callable from terminal.
- Run mux in a flow that triggers the devcontainer version check.
- Observe that mux reports
devcontainer as missing/unavailable.
Expected behavior
Mux should detect devcontainer successfully on Windows when the CLI is installed and in PATH.
Actual behavior
Detection fails because spawn("devcontainer", ...) does not reliably resolve the Windows command variant.
Environment
- OS: Windows (10/11)
- Repo:
coder/mux
- File:
src/node/runtime/devcontainerCli.ts
- Observed near: line 181
- Commit referenced:
370cb3b97f5a173fc6c8ea88edcd0f1b16bf6e9f
Possible fix
Either of these approaches should make detection cross-platform-safe:
- Use
spawn(..., { shell: true }) for this command check, or
- Replace direct
spawn with a wrapper like cross-spawn, which handles Windows command resolution (PATHEXT, .cmd/.bat, etc.) more reliably.
Additional notes
Happy to test a patch on Windows if helpful.
muxappears to fail detecting an installeddevcontainerCLI on Windows.At
src/node/runtime/devcontainerCli.ts(around line 181), the code runs:Source: https://github.com/coder/mux/blob/main/src/node/runtime/devcontainerCli.ts#L181
On Windows,
devcontaineris often resolved through extensions such as.bat/.cmd/.ps1. With plainchild_process.spawn(...)(without shell resolution or a cross-platform wrapper), command lookup can fail even whendevcontaineris installed and available inPATH.Steps to reproduce
devcontainerCLI correctly installed and callable from terminal.devcontaineras missing/unavailable.Expected behavior
Mux should detect
devcontainersuccessfully on Windows when the CLI is installed and inPATH.Actual behavior
Detection fails because
spawn("devcontainer", ...)does not reliably resolve the Windows command variant.Environment
coder/muxsrc/node/runtime/devcontainerCli.ts370cb3b97f5a173fc6c8ea88edcd0f1b16bf6e9fPossible fix
Either of these approaches should make detection cross-platform-safe:
spawn(..., { shell: true })for this command check, orspawnwith a wrapper likecross-spawn, which handles Windows command resolution (PATHEXT,.cmd/.bat, etc.) more reliably.Additional notes
Happy to test a patch on Windows if helpful.