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

オープン
#176 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, node.js

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
726
フォーク
102
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vitejs/launch-editor のほかの issue

vitejs/launch-editor の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。