fix(desktop): Open in editor (IDE ↗) finds no editors on Windows — PATH-only detection, no %LOCALAPPDATA%/App Paths fallback
Bug
On Windows, the "Open in editor" (IDE ↗) topbar control cannot open the session workspace in Cursor, VS Code, or any other editor — even when those editors are installed. The control reports no supported editors found, so the primary button is permanently disabled.
Source: reported in Discord #bug-triage | Reported by: @Vaibhaav-Tiwari | Analyzed against: 9997248c4 (origin/main, 2026-09-01)
Confidence: Medium — mechanism traced in code and consistent with the report; the reporter's machine has not been probed (see "Open questions").
Reproduction
- Windows 10/11, AO desktop ≥ v0.12.10 (feature landed in d2fec68c2, Aug 23 — shipped in v0.12.10).
- Install Cursor and/or VS Code with default installer options (User Installer — the default on Windows — does not add
binto PATH unless "Add to PATH" is checked; thecursor/codeshims live under%LOCALAPPDATA%\Programs\...). - Open any local session → look at the topbar
IDE ↗control. - Actual: primary button disabled; dropdown shows no editors; guidance: "No supported editor found. Use File Explorer or Command Prompt, or install Cursor." — despite Cursor/VS Code being installed.
- Expected: Cursor / VS Code detected and clickable.
Root Cause
Editor detection on Windows is a PATH-only scan with no fallback probing — while macOS gets an explicit app-bundle fallback and Linux gets hardcoded extra dirs.
frontend/src/main/editor-handoff.ts:
commandSearchDirs()(lines 92–96): forwin32it returns onlyenv.PATHsplit entries. Compare: darwin appends/opt/homebrew/binetc., linux appends/usr/local/bin,/usr/bin. There is no Windows equivalent.resolveEditor()(lines 112–128): after the PATH scan misses, the.appbundle fallback (lines 122–127) is gated behindif (deps.platform !== "darwin") return undefined;— so on Windows detection ends at "not installed."EDITOR_CANDIDATES(lines 27–47): each candidate has exactly onecommands[]entry (cursor,code,windsurf, …). The standard Windows install locations are never probed:- VS Code / VS Code Insiders / Cursor / Windsurf user installs:
%LOCALAPPDATA%\Programs\{Microsoft VS Code,Cursor,Windsurf}\bin\{code,cursor,windsurf}.cmd(also{version}\binlayout for VS Code) - System installs:
%ProgramFiles%\...\bin - JetBrains Toolbox:
%LOCALAPPDATA%\JetBrains\Toolbox\scripts\(idea.cmd,webstorm.cmd, …) - Windows
App Pathsregistry (HKCU\Software\Microsoft\Windows\CurrentVersion\App Paths\code.exe) — the OS-blessed lookup thatShellExecute/startuse
- VS Code / VS Code Insiders / Cursor / Windsurf user installs:
- On Windows the CLIs are
.cmdshims, not.exe—executableNames()(lines 86–90) does handle PATHEXT expansion for names within a search dir, so this is not the failure; the failure is that the dirs themselves are PATH-only. - Additionally,
createEditorHandoff()(lines 163–165) resolves the editor list once at module construction (wired atfrontend/src/main.ts:699). If PATH/environment differs at launch (e.g. app auto-started, or user installs an editor later and doesn't restart AO), the list is stale for the entire app lifetime.
Renderer behavior when detection finds nothing — frontend/src/renderer/components/TopbarOpenEditorButton.tsx:
- Line 88:
const mainDisabled = busy || !workspaceAvailable || !preferred;— witheditors.length === 0,preferredisundefined→ primary button permanently disabled. - Lines 96–99: shows
editor.noEditorGuidance→ "No supported editor found. Use File Explorer or Command Prompt, or install Cursor." — misleading on a machine where Cursor is installed. - Note
DEFAULT_EDITOR_ID = "cursor"(frontend/src/main/editor-settings.ts:6), so the default preference is also among the "not found" set.
Not the cause (verified): the launch path handles Windows shims correctly — frontend/src/main/launch-command.ts spawnSpec() wraps .cmd/.bat via cmd.exe /d /s /c with windowsVerbatimArguments. The gap is purely detection/resolution, and secondarily the misleading guidance.
This mirrors the class of issue the feature's own spec called out (#3118 acceptance criteria: "Failures are visible (not silent); works when app launched from Dock" — the Windows analog, "works when app launched without the editor's shims on PATH," is unmet).
Fix Direction
- Add Windows fallback search roots in
commandSearchDirs()/resolveEditor():%LOCALAPPDATA%\Programs\*per-candidatebindirs (match on{code,cursor,windsurf,...}.cmd),{Version}\binfor VS Code family%ProgramFiles%,%ProgramFiles(x86)%install roots%LOCALAPPDATA%\JetBrains\Toolbox\scripts- Optionally
App Pathsregistry lookup viareg query(keeps it dependency-free)
- Keep PATH-first ordering so an explicit PATH install wins over a probed one.
- Re-resolve editor targets per
getState()call (or cache with TTL) instead of freezing at app start, so a mid-session install or environment change is picked up. - If zero editors are detected on win32 after probing, keep the File Explorer/Terminal fallbacks but improve guidance (e.g. "Open {worktree} in File Explorer" is already there; the "install Cursor" line should not be the only hint when the editor may merely be off-PATH).
- Add
win32coverage tofrontend/src/main/editor-handoff.test.ts(currently zero win32 cases) covering: shim in PATH, shim only in%LOCALAPPDATA%, PATHEXT expansion, and none-found.
Impact
- All Windows users whose editor CLI shims are not on the GUI process's PATH (default User Installer path for VS Code; common for Cursor when "Add to PATH" was skipped) cannot use the
IDE ↗feature at all — the feature is effectively macOS/Linux-only for them. - The error guidance blames a missing install, sending users to reinstall editors that are already present.
Open questions (from the reporter's machine)
- Exact AO version and whether the dropdown shows some editors or none (distinguishes "PATH miss for all" vs "partial detection").
- Whether Cursor/VS Code were installed per-user (
%LOCALAPPDATA%) or system-wide. - Terminal/File Explorer targets (which don't depend on PATH for file-manager, and use
ComSpecfor terminal) presumably still work — worth confirming the report is editor-specific.
Related
- #3118 — feature spec: "Open session worktree in external IDE (
IDE ↗+ target menu)" - #4571 — cloud-session gating for the same control (d2a134db7)
- #4607 — Neovim target request (same surface)
Assign me this issue pls.