open-in-editor guesses `code` and opens VS Code instead of the session IDE

Aperta
#176 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js

Direzione di ricerca

Start by reading launchEditor and guessEditor, especially the Linux editor list and the code that launches the selected binary. Check how the process environment exposes VSCODE_GIT_ASKPASS_NODE and how the project tests editor detection. Done means the session’s remote CLI is preferred when available, cursor is not shadowed by code, and a Windows shim is avoided when a Linux remote CLI exists.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

launchEditor(target) with no editor argument opens Windows VS Code when the dev server is running in WSL from Cursor.

What happens

Vite DevTools Pick element calls launchEditor(path) and does not pass an editor. On Linux, guessEditor scans ps and returns the first name in COMMON_EDITORS_LINUX that occurs as a substring. code is listed before cursor. The binary that then runs is code on PATH.

In this WSL session that binary is the Windows shim:

/mnt/c/Program Files/Microsoft VS Code/bin/code

So Pick element opens VS Code.

Why the session IDE is invisible

The Cursor window is on Windows. ps inside WSL does not show it, so the scan cannot pick cursor.

The editor for this session is the remote CLI next to VSCODE_GIT_ASKPASS_NODE:

$VSCODE_GIT_ASKPASS_NODE  →  <commit>/node
remote CLI                →  <commit>/bin/remote-cli/cursor

launch-editor never reads VSCODE_GIT_ASKPASS_NODE. A cursor remote CLI on PATH is also ignored, because detection uses ps, not command -v.

LAUNCH_EDITOR does select the right program when it is set to that remote CLI. Nothing sets it automatically.

Expected

Open-in-editor should use the IDE that owns the session.

  • Prefer the remote CLI beside VSCODE_GIT_ASKPASS_NODE when that file exists (cursor or code).
  • Do not let a substring match of code win over cursor.
  • Do not run a /mnt/.../code Windows shim when a Linux remote CLI for the current session exists.

This is not a request to hard-code Cursor. The same gap exists for any editor whose UI runs on the Windows side of WSL while the dev server runs in Linux.

Lingua principale
JavaScript
Stelle
726
Fork
102
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vitejs/launch-editor

Tutte le issue di vitejs/launch-editor

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.