Skip to content

fix(vscode): PATH-fallback probeCandidate uses shell:false — Windows .cmd/.bat shims (Scoop etc.) silently fail #2079

Closed

Description

@EffortlessSteven

Problem

`editors/vscode/src/serverResolver.ts:73` always tries `ripr` on PATH as
the final fallback in the documented resolution order
(`ripr.server.path` > bundled > cached > downloaded > PATH > actionable
error). The probe at `serverResolver.ts:120-155`:

  • spawns ` --version` with `shell: false` (`serverResolver.ts:122`)
  • has a 5-second timeout (`START_TIMEOUT_MS = 5000`, line 9)

On Windows, `cp.spawn` with `shell: false` does not do PATHEXT
resolution. A user with `ripr.bat` or `ripr.cmd` on PATH (the common
case for Scoop / Chocolatey / a manually-added shim) hits
"could not start" (`serverResolver.ts:138`) with no hint that PATHEXT is
the problem. They are sent down the "install with cargo install ripr" path
even though `ripr` is already installed and runnable from a terminal.

Fix

On win32, either:

  1. Pass `shell: true` for the PATH-fallback probe (simplest, but inherits
    shell quoting concerns), or
  2. Iterate PATHEXT extensions (`.exe`, `.bat`, `.cmd`, `.ps1`) for
    the bare `ripr` name and probe each.

Option 2 matches VS Code's own `which` behavior and avoids the shell-quoting
footgun.

Evidence

  • `editors/vscode/src/serverResolver.ts:73` — PATH is the final fallback
  • `editors/vscode/src/serverResolver.ts:120-155` — `probeCandidate`
  • `editors/vscode/src/serverResolver.ts:122` — `shell: false`
  • `editors/vscode/src/serverResolver.ts:9` — `START_TIMEOUT_MS = 5000`

Non-goals

  • Changing the resolution order.
  • Bundling the server binary (separate concern).

Activity

  1. added
    vscode
    on Jul 21, 2026
  2. coderabbitai commented on Jul 21, 2026

    @coderabbitai
    🔗 Related PRs

    #1612 - fix(lsp): reject ambiguous workspace roots [merged]
    #2059 - fix(vscode): point retry fallback at the registered 'ripr: Restart Server' command (#2001) [merged]
    #2060 - fix(vscode): auto-start when a workspace folder appears after no-workspace start (#2015) [open]
    #2063 - fix(vscode): auto-start the server when a workspace folder appears (#2015) [open]
    #2065 - ux(vscode): show download progress and disclose the release fetch (#2002) [open]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. EffortlessSteven commented on Jul 21, 2026

    @EffortlessSteven
    MemberAuthor

    Status: still open on current main

    Verified editors/vscode/src/serverResolver.ts:120-155: probeCandidate still spawns with cp.spawn(command, ['--version'], { shell: false }) (line 122), hardcoded with no win32 branch and no PATHEXT iteration. The PATH fallback at line 73 (probeCandidate('ripr', 'path', ...)) is unchanged.

    Evidence

    • editors/vscode/src/serverResolver.ts:120-155 — shell: false hardcoded.
    • editors/vscode/src/serverResolver.ts:73 — PATH fallback uses the same unconfined probe.
  4. added
    status/needs-work
    on Jul 21, 2026
  5. EffortlessSteven commented on Jul 21, 2026

    @EffortlessSteven
    MemberAuthor

    Fixed in the linked PR via option 1: the PATH-fallback probe uses shell: true on win32 only. Rationale for option 1 over PATHEXT iteration: .bat/.cmd/.ps1 shims need a shell to execute regardless, and the spawned command is the constant ripr --version — no user input reaches the shell, so the quoting concern does not apply. Explicit-path probes keep shell: false. vscode-compile clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/needs-workvscode

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions