Skip to content

feat: render TUI on /dev/tty for Helix and other editor embedding#2925

Open
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:feat/helix-tty-2556
Open

feat: render TUI on /dev/tty for Helix and other editor embedding#2925
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:feat/helix-tty-2556

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

Fixes #2556.

Helix :insert-output captures stdout, so gitui could not open its TUI. This change:

  • On Unix, if stdout is not a terminal, automatically opens /dev/tty for rendering (covers Helix without gitui >/dev/tty in the keymap).
  • Adds --tty to force /dev/tty on Unix (documented in --help).
  • Routes terminal setup, shutdown, external editor screen switching, and ratatui through a shared TerminalWriter.

Windows: --tty returns an error; normal stdout behavior is unchanged.

Helix usage

[keys.normal]
C-g = [
  ":write-all",
  ":new",
  ":insert-output gitui",
  ":buffer-close!",
  ":redraw",
  ":reload-all",
]

Test plan

  • cargo check
  • cargo test verify_app
  • CI

Made with Cursor

leno23 and others added 2 commits May 17, 2026 10:56
When stdout is not a terminal (e.g. Helix :insert-output), use /dev/tty
on Unix so gitui can run interactively. Add --tty to force this behavior.

Fixes gitui-org#2556

Co-authored-by: Cursor <cursoragent@cursor.com>
Return an error if --tty is set but /dev/tty is unavailable (e.g. macOS
permissions). Add unit tests for terminal_io.

Co-authored-by: Cursor <cursoragent@cursor.com>
@leno23
Copy link
Copy Markdown
Author

leno23 commented May 17, 2026

Pushed a follow-up: --tty now returns an error if /dev/tty cannot be opened (helps macOS permission cases from the issue thread). Local make clippy and cargo test terminal_io pass.

Note: the CI workflow shows action_required for this fork PR — a maintainer may need to approve running workflows on the first contribution from this fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support opening inside of Helix

1 participant