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

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
Mezza giornata
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, neovim

Direzione di ricerca

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.

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

Descrizione

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.

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.