l0ng-aiandl0ng-ai 59a4c9d859 fix(terminal): stop severing wide Nerd Font prompt glyphs (#17) (#31)
* fix(terminal): give solo prompt glyphs a two-cell paint window

Nerd Font prompt icons and the multiline `➜`/`❯` rendered sliced off on
the right (#17). tty7 paints any single-column glyph clipped to exactly
one cell, but a symbol face routinely draws ink past that cell: a
non-Mono Nerd Font sets a one-cell *advance* on its icons yet fills up to
~1.9 cells (measured across Hasklug / Meslo / JetBrainsMono NF), and the
OS cascade serves a proportional `➜` the same way when nothing in the
font list covers it. The per-cell content mask then severed the overflow
— the incomplete icons and cut-off arrow in the report.

Advance is no signal here (it reads one cell for those overflowing
icons), so widen every solo glyph's clip to two cells. A glyph that
already fits is untouched — it has no ink to spill — while a symbol that
overflows renders whole, bleeding into a trailing blank the way iTerm2
and Terminal.app do with non-Mono faces; the two-cell bound keeps a
pathological face from smearing a lone glyph across the row. Batched
Run/Wide segments keep their exact column-span clip, and Mono Nerd Fonts
are pixel-identical. Pairs with the native powerline separators from #19.

Verified in-app on Apple Silicon with a non-Mono "Hasklug Nerd Font"
primary: icons and a powerline prompt that were severed now render whole,
with no change to ASCII, CJK, or the Mono-font path.

* test(terminal): cover both clip-width branches, not just the solo constant

Fold the solo/batched clip-width decision into one pure `seg_clip_width`
so the branch itself is testable (per PR review): the test now asserts a
batched Run/Wide segment clips to its exact column span while a solo
glyph gets the two-cell window, instead of only checking the standalone
constant. No behavior change.

---------

Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com>
2026-07-08 22:10:49 +08:00
2026-07-08 17:43:37 +08:00
2026-07-08 17:43:37 +08:00

tty7

tty7

A GPU-rendered terminal in pure Rust.

GPU rendering on Zed's gpui · VT core from Alacritty


CI Version License Discord

Install · Benchmarks · Shortcuts · Contributing

English · 简体中文


tty7

tty7 is a GPU-rendered terminal. An 11 MB cat finishes in 95 ms — about 2× faster than Alacritty, Ghostty, or Kitty on the same hardware — and the built-in prompt gives you inline completion, syntax highlighting, and per-flag hints for common commands. Pure Rust, native on macOS, Windows, and Linux, no configuration needed.

  • Fast — an 11 MB cat completes in 95 ms, versus 179239 ms for Alacritty/Ghostty/Kitty; DOOM-fire renders at 888 fps against their 485617. Same machine, same grid; the harness is in the repo (benchmarks).
  • ⌨️ Prompt with completions — inline completion, syntax highlighting, history, and in-terminal search. Type git commit --, kubectl, or npm and every flag and subcommand shows up with its description — signatures for ~100 common commands, generated from Fig's spec corpus.
  • 🧠 Shell-aware, zero config — new tabs and splits open in the current working directory, and path completion always follows where you are. zsh, bash, fish, and PowerShell are wired up automatically.
  • 🔌 Sessions that survive — shells run in a background daemon, so closing a window, quitting the app, or swapping in a new build never takes a shell down. Detach and reattach, no tmux.

Also included: tabs (drag to reorder, inline rename, number keys to switch) and resizable splits, a command palette, click-to-open links, desktop notifications, and focus-follows-mouse. Eight built-in themes from light to dark, with the native window chrome following the one you pick, plus CJK/IME input.

Native builds for macOS, Windows, and Linux — every release ships all three.



📊 Benchmarks

All four terminals measured back-to-back on the same machine, same day, same 155×40 grid — Apple M1 Pro, macOS 26.3.1, five-run averages (2026-07-04):

tty7 Alacritty Ghostty Kitty
Plaintext IO — 11 MB cat (lower = better) 95 ms 239 ms 179 ms 185 ms
DOOM-fire frame rate (higher = better) 888 fps 485 fps 552 fps 617 fps
Cold-launch memory 116 MB¹ 105 MB 128 MB 130 MB

¹ GUI 105 MB + the persistent daemon 11 MB.

tty7 reads the PTY at device speed and parses it in large batches off the render path, and the hot paths are lock-free — so a big cat never waits on drawing. (That's also what the background daemon buys you: it can run up to 16 MiB ahead of the window before backpressure applies.)

Methodology (how each terminal is driven, grid fairness, known pitfalls) and one-command reproduction live in scripts/bench/ — run it yourself.

🚀 Install

Download the build for your platform from Releases:

  • macOStty7-<version>-macos-arm64.dmg (Apple Silicon) or …-x86_64.dmg (Intel); open it and drag tty7.app into Applications.
  • Windows…-windows-x86_64-setup.exe (installer: Start Menu shortcut + uninstall entry), or …-windows-x86_64.zip (portable: unzip and run tty7.exe).
  • Linux…-linux-x86_64.tar.gz; extract and run ./tty7 (needs the usual x11/wayland runtime libraries).

⌨️ Shortcuts

Keys are shown in macOS notation — on Windows and Linux, read as Ctrl. Open Settings with ⌘ , to browse or remap them all. The essentials:

⌘ T · ⌘ W · ⌘ ⇧ T new tab · close tab · reopen closed tab
⌘ D · ⌘ ⇧ D split right · split down
⌘ ] · ⌘ [ next pane · previous pane
⌘ ⏎ · ⌘ ⇧ ⏎ toggle fullscreen · maximize / restore the pane
⌘ K clear the screen and scrollback
⌘ P command palette
⌘ F search the scrollback
⌃ R reverse-search shell history
⌘ + · · ⌘ 0 font size up · down · reset

The full list — and any overrides — lives in Settings → Keybindings.

💭 Built with & inspired by

🤝 Contributing

Bug reports and PRs are welcome. For questions and ideas, join the Discord. Notable changes land in the CHANGELOG.

📝 License

Apache License 2.0 · © 2026 l0ng-ai


tty7 — a GPU-rendered terminal in pure Rust.

S
Description
A terminal workbench in pure Rust: shells, persistent sessions, SSH, coding agents. GPU-rendered on Zed's gpui, VT core from Alacritty.
Readme Apache-2.0
34 MiB
Languages
Rust 99.1%
Shell 0.5%
PowerShell 0.2%
Inno Setup 0.1%