Skip to content

fix: keep line and column for Cursor, Trae and Antigravity on Windows - #163

Open
mkantautas wants to merge 1 commit into
vitejs:mainfrom
mkantautas:fix/windows-editor-position
Open

mkantautas wants to merge 1 commit into
vitejs:mainfrom
mkantautas:fix/windows-editor-position

Conversation

@mkantautas

Copy link
Copy Markdown

When automatically detecting an editor on Windows, guessEditor returns the full path of the running editor, such as C:\Users\me\AppData\Local\Programs\cursor\Cursor.exe. getArgumentsForFile strips the directory and .exe, leaving Cursor, Trae or Antigravity. The switch only has the lowercase names, so these three editors get just the file name: the requested line and column are not passed to the editor. Code, Code - Insiders and VSCodium already have cases for their Windows names.

This adds Cursor, Trae and Antigravity next to the lowercase cases, so they get -r -g file:line:column like Code.

Possibly related: #115 (Antigravity opens the file but not at the line; the report doesn't say which OS).

Tests: the three names are added to the -r -g list, and the Windows-only block gets full-path .exe cases. The list tests fail without the fix. pnpm test, pnpm format --check and pnpm oxlint pass on Node 24 (Linux); pnpm test also passes on Node 26 (macOS). I ran the Windows-only tests with process.platform and path.win32 stubbed, not on Windows, and didn't try the editors themselves.

adamchainz pushed a commit to adamchainz/launch-editor-py that referenced this pull request Oct 28, 2026
Running editors on Windows are launched by full path, so their
capitalized executable names, like Cursor.exe, weren't recognized and
the line and column were dropped. Ported from upstream's unmerged
vitejs/launch-editor#163.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1f9YvZFt329anqrwH8KGJ

This branch has not been deployed

No deployments
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.

1 participant