mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-21 16:02:20 +00:00
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.
25 lines
1016 B
Diff
25 lines
1016 B
Diff
diff --git a/src/main.zig b/src/main.zig
|
|
index cceca94..342c9f2 100644
|
|
--- a/src/main.zig
|
|
+++ b/src/main.zig
|
|
@@ -690,6 +690,19 @@ pub fn paintBuf() !void {
|
|
|
|
try emit(fg[0]);
|
|
try emitFmt("mem: {s:.2} min / {s:.2} avg / {s:.2} max [ {d:.2} fps ]", .{ std.fmt.fmtIntSizeBin(bs_sz_min), std.fmt.fmtIntSizeBin(bs_sz_avg), std.fmt.fmtIntSizeBin(bs_sz_max), fps });
|
|
+
|
|
+ // bench patch: periodically dump the cumulative fps to $DOOM_FPS_FILE so a
|
|
+ // harness can collect the average without recording the output stream.
|
|
+ if (bs_frame_tic % 30 == 0) {
|
|
+ if (std.posix.getenv("DOOM_FPS_FILE")) |fps_path| {
|
|
+ if (std.fs.createFileAbsolute(fps_path, .{ .truncate = true })) |f| {
|
|
+ defer f.close();
|
|
+ var fps_buf: [64]u8 = undefined;
|
|
+ const fps_str = std.fmt.bufPrint(&fps_buf, "{d:.2}\n", .{fps}) catch return;
|
|
+ f.writeAll(fps_str) catch {};
|
|
+ } else |_| {}
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
// initBuf(); defer freeBuf();
|