Better support for terminal editors (nvim, helix): avoid `stdio: 'inherit'`, reuse running instances

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

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

評価

難易度
2/5
見積もり時間
半日
初心者へのやさしさ
50/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, neovim

調査の方向性

Start in get-args.js, where the vim-style line and column arguments are mapped, and in the isTerminalEditor list, which decides whether an editor gets its own terminal; the issue also mentions the stdio: 'inherit' spawn path and the editor lists. Confirm with a maintainer before changing spawn behaviour, since the proposal is not yet accepted. Done means nvim and hx get the correct file:line:col arguments and are recognised as terminal editors, with the README section on LAUNCH_EDITOR recipes added.

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

説明

Clicking "open in editor" from Vite / Vue DevTools / Nuxt DevTools doesn't really work with terminal editors today:

  1. TUI editors are spawned with stdio: 'inherit', so they share the dev server's terminal (often busy or in another window) instead of getting their own.
  2. nvim and hx aren't recognized: no line/column args in get-args.js, and they're missing from isTerminalEditor, so each click spawns another instance.

LAUNCH_EDITOR (#39 / #49) is a good escape hatch, and I understand built-in TUI handling may be out of scope. I'd like to propose, and am happy to implement:

  • Small code change: add nvim (same args as vim) and hx (file:line:col) to the arg mappings, isTerminalEditor, and the editor lists.
  • A README section on terminal editors, documenting LAUNCH_EDITOR recipes in three layers:
    • open a new window of the default terminal;
    • open a tab or split in the terminal the dev server runs in (kitty / wezterm / ghostty remote control);
    • open in a tmux or zellij pane.
    • For reuse: if this project already has an nvim running, open the file as a buffer via nvim --server <socket> --remote instead of starting a new process. Helix has no remote-open API yet (helix-editor/helix#312), so for now it relies on the multiplexer approach.

Would you accept a PR for the mappings plus docs? If you'd rather keep any of this out of the core library, docs only works for me too.

主要言語
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 を短くまとめたダイジェスト。