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

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
Medio día
Aptitud para principiantes
50/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, neovim

Línea de trabajo

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.

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

Descripción

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.

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.