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

Abierto
#176 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, node.js

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
726
Forks
102
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vitejs/launch-editor

Todos los issues de vitejs/launch-editor

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.