Files
tty7/scripts/bench/setup.sh
l0ng-ai 22e1ab1694 tty7: a GPU-rendered, daemon-backed terminal in pure Rust
tty7 is split into two Rust processes: a persistent daemon that owns the
shells and a GPU-rendered client that talks to it over a local socket.
Because the shells live in the daemon, quitting and reopening the app
leaves the session intact — detach and reattach, no tmux required.

- Persistent sessions — the daemon holds the PTYs and child processes, so
  closing a window or swapping in a new build never takes a shell down.
- Performance — an 11 MB `cat` completes in 95 ms and DOOM-fire renders at
  888 fps; the daemon drains the PTY at device speed off the render path.
- Shell-aware — new tabs and splits open in the current working directory;
  zsh, bash, fish, and PowerShell are set up automatically.
- Enhanced prompt — inline completion, syntax highlighting, history, and
  in-terminal search, with rich flag/subcommand signatures for common tools.
- Tabs, resizable splits, a command palette, click-to-open links, desktop
  notifications, eight themes, and CJK/IME input.

Native builds for macOS, Windows, and Linux.
Built on Zed's gpui and Alacritty's VT core.
2026-07-06 21:54:27 +08:00

47 lines
1.7 KiB
Bash
Executable File

#!/bin/zsh
# One-time setup for the terminal benchmark harness (see README.md).
# Fetches everything into the gitignored work dir ($TTY7_BENCH_DIR, default
# <repo>/.bench): the 11 MB plaintext corpus, DOOM-fire-zig (patched to dump
# its fps for collection), and a zig 0.14 toolchain if the system one is newer
# (DOOM-fire-zig pins 0.14; the build API changed in 0.15+). macOS only.
set -e
SELF=${0:A}
HERE=${SELF:h}
REPO=${HERE:h:h}
WORK=${TTY7_BENCH_DIR:-$REPO/.bench}
mkdir -p $WORK
# 1) 11 MB Shakespeare corpus — the plaintext-IO payload from the methodology
# source, moktavizen/terminal-benchmark.
if [ ! -f $WORK/shakespeare.txt ]; then
echo "fetching shakespeare.txt (11 MB)…"
curl -fsSL -o $WORK/shakespeare.txt \
https://raw.githubusercontent.com/moktavizen/terminal-benchmark/main/test/shakespeare.txt
fi
# 2) DOOM-fire-zig, with the fps-dump patch applied (doom-fire-fps.patch).
if [ ! -d $WORK/DOOM-fire-zig ]; then
git clone --depth 1 https://github.com/const-void/DOOM-fire-zig.git $WORK/DOOM-fire-zig
git -C $WORK/DOOM-fire-zig apply $HERE/doom-fire-fps.patch
fi
# 3) zig 0.14.x. Use the system zig when it matches, else download 0.14.1.
ZIG=zig
if ! zig version 2>/dev/null | grep -q '^0\.14'; then
arch=$(uname -m)
[ "$arch" = arm64 ] && arch=aarch64
zdir=$WORK/zig-$arch-macos-0.14.1
if [ ! -x $zdir/zig ]; then
echo "downloading zig 0.14.1 ($arch)…"
curl -fsSL https://ziglang.org/download/0.14.1/zig-$arch-macos-0.14.1.tar.xz | tar -xJ -C $WORK
fi
ZIG=$zdir/zig
fi
# 4) Build the fire.
if [ ! -x $WORK/DOOM-fire-zig/zig-out/bin/DOOM-fire ]; then
(cd $WORK/DOOM-fire-zig && $ZIG build -Doptimize=ReleaseFast)
fi
echo "bench setup complete: $WORK"