What Fibo is: a native workbench for coding agents such as Claude Code and Codex, open source under MIT. Every session is a real terminal inside the window; a background process,fibo serve, owns all of them, so closing the window does not stop a session. Fibo used to be called Mooring, and before that Keepline; the evaluation below happened in the Keepline days. Install: download the DMG orbrew install --cask majiayu000/tap/fibo.
01 The target: 40 sessions, 4 panes, no heavier than 1.2x Ghostty
Fibo is for people who keep 10 to 40 Claude Code and Codex sessions open at once. The shape of the product was settled on the night of October 19: an app made for running and managing agents, where every session is a real terminal and the native CLI runs in the app's own PTY. The requirement, as it was put then, was "a high-performance terminal-type product".
"High performance" first had to become something measurable. The work view is spaces, tabs, and 2 to 4 panes per tab, so the load became 40 sessions with 4 panes visible in one tab and the other 36 parsed in the background without being drawn. The budget is relative: on the same machine under the same load, the total must stay within 1.2x of Ghostty. Two absolute rules sit next to it: nothing renders while the window is hidden, and nothing polls while idle.
The unit of measure cost us once. The first estimate used RSS from ps, which put a long-running Ghostty at 121 MB; phys_footprint, which counts GPU memory and compressed memory, put the same process at 800 MB. RSS misses exactly the parts a graphical program spends, so every number from then on is phys_footprint, with WebKit, XPC and GPU helper processes added to the measured set, and CPU is cumulative CPU time divided by wall-clock time.
| Item | Definition in the evaluation |
|---|---|
| Load | 40 sessions, 4 panes visible (2x2), 120x40 cells per pane; 1440x900 pt window, Menlo 12 pt |
| Memory | Sum of phys_footprint over the measured process set, sampled every 5 s, median and peak |
| CPU | Cumulative CPU time of the set divided by wall-clock time; 100% is one core |
| Budget | At most 1.2x Ghostty on the same machine and load; when both sides use under 0.5% CPU it counts as noise |
| Repeats | 5 runs per cell in shuffled order, median reported; single first runs only set direction |
| Workload | Synthetic output plus a real Codex recording: 250 s, 1.5 MB, 4223 synchronized-output frames with heavy cursor addressing and Chinese text |
02 The original plan: Tauri + React + xterm.js
The previous generation of Keepline was a Bun CLI, a web dashboard and a Tauri menu-bar app, released up to v1.1.4. The terminal-workbench spec written on October 19 continued that stack. Its two key decisions:
- D01: the app is the main entry point and stays on Tauri + React, reusing the existing workbench UI, menu bar and notifications.
- D03: a Rust background process parses the PTY with
alacritty_terminaland owns the authoritative terminal state; the window shows a mirror of it in xterm.js, borrowing xterm.js's input, drawing, selection and IME support.
The spec itself called D03 "the highest-risk point of the plan": the background would have to re-encode alacritty's state as VT sequences xterm.js can consume, with snapshots covering both screens, scroll regions, graphemes, the cursor and every input mode, and there was no serialization API to start from.
The background had its own problem. Keepline's Bun service held about 240 MB of data while watching only 73 sessions, and rescanned every 5 seconds; the Bun runtime itself was about 22 MB, so the weight came from keeping the data in memory and polling. That holds whatever draws the window, so it was settled first: everything resident moves into one Rust background process, transcripts are read incrementally from an offset and driven by events, and Bun no longer stays running.
03 The WebView control: ~3.5x the memory, mostly in the GPU process
To find the floor of the WebView route, we first wrote a minimal macOS test program: xterm.js 6 inside the system WKWebView, fed the same output (mixed Chinese and English, colored) as a freshly started Ghostty with its own config, both measured with phys_footprint.
| Scenario | Memory (phys_footprint) | CPU |
|---|---|---|
| Ghostty, 1 window, 400 KiB/s | 289 MiB | 14% |
| WebView + xterm.js (WebGL), 1 pane, 400 KiB/s | 1029 MiB, 3.56x | 15% |
| WebView + xterm.js (WebGL), 4 panes at 100 KiB/s each | 742 MiB, of which the WebKit GPU process 466 MiB | 23% |
| WebView + xterm.js (DOM renderer), 4 panes at 100 KiB/s | 452 MiB | 128%, dropped frames |
| WebView window minimized, 4 panes at 100 KiB/s | not recorded | 0.3% |
CPU was about even; memory was not, and the growth was in WebKit's GPU process. That comes from WebKit's process model, not from xterm.js, so one WebView per pane and several WebGL contexts in one WebView both hit it. The DOM renderer saves memory and spends 128% CPU instead. Minimized, CPU fell to 0.3%, so WebKit throttles content you cannot see; that went onto every candidate's correctness list, since a native route has to stop drawing when hidden too.
These were single runs, not five. The evaluation notes why that was enough: a 3.5x gap dwarfs any plausible measurement noise, and a 1.2x memory budget cannot be met from there, so more runs could not change the answer. The WebView route was rejected at this step, and D01 and D03 with it.
04 Terminal state in the background: three VT libraries
The background has to hold the screen and scrollback of 40 sessions and hand the current screen over in full whenever a window reconnects. The evaluation did not pick a whole terminal; it split the stack into 10 layers (PTY, VT parsing and state, Unicode, fonts, GPU rendering, IME and keyboard, scrollback, the session-sharing protocol, the UI framework, ready-made terminal widgets) and recorded 99 entries: 69 candidates and 30 references. Three VT libraries reached measurement: libghostty-vt (through the libghostty-rs bindings), the original plan's alacritty_terminal 0.26.0, and rio-vt 0.5.28.
| Metric (median of 5) | libghostty-vt | alacritty_terminal | rio-vt |
|---|---|---|---|
| Empty session, each | 0.025 MiB | 0.27 MiB | 0.11 MiB |
| 10,000 lines of history, per session | 9.8 MiB | 32 MiB | 10.3 MiB |
| 40 sessions, whole process | 405 MiB | 1.29 GiB | 427 MiB |
| After idle compression | 66.5 MiB | none | none |
| Snapshot (10,000 lines) | full: 6.8 MB, encode 2.3 ms, restore 5.0 ms, first screen drawable after 0.09 ms | not supported | visible screen only, drops combining marks |
| esctest2 passes (of 567) | 147 | 101 | 101 |
| Parsing the real Codex recording | 4.3 ns/byte | 4.58 | 4.61 |
A few details:
- esctest's absolute failure counts are high: esctest2 treats xterm as the reference and reads screen contents through DECRQCRA checksums, which none of the three support, so only the relative gap means anything. alacritty and rio fail 59 more tests than Ghostty (DECRQM, DECRQSS, cursor movement under DECLRMM left/right margins and more); the reverse is 14. rio and alacritty fail exactly the same set, since rio's terminal core derives from alacritty.
- One finding was overturned: on a synthetic TUI load of random true colors, libghostty-vt parsed 1.9x slower than alacritty. Rerun on the real Codex recording, the three were within 7% of each other and libghostty-vt was fastest. The slowdown came from the load: a random 24-bit color per line keeps growing the style table, which real TUIs do not do. The finding was struck; the raw data stays.
- Parsing CPU does not separate them: the worst case, 4 panes at 100 KiB/s each, costs about 0.5% of one core.
The decision record lists libghostty-vt's costs too: upstream has no releases and the snapshot API lives only on main, so it is pinned to a commit; the bindings are maintained by one person; the build pulls in the Zig 0.16 toolchain, and Cargo's debug profile builds the Zig part in Debug unless LIBGHOSTTY_VT_SYS_OPTIMIZE=ReleaseFast is set; it statically includes simdutf, so it cannot be linked into one binary with rio-vt, which does the same; and mode 2027 has to be turned on for grapheme widths to match Ghostty.app.
05 The window: three prototypes against Ghostty
With libghostty-vt chosen for the background, the window was next. A minimal session-sharing prototype, kl-relay, sat between them (40 idle sessions: 35 MiB, 0.13% CPU), and three client prototypes connected to it:
- P1: GPUI + alacritty_terminal, as the control. GPUI is the Rust UI framework of the Zed editor, pinned at Zed v1.24.3.
- P2: Swift + GhosttyKit (libghostty-spm), using Ghostty's complete terminal widget for each pane.
- P3: GPUI + libghostty-vt: the same VT engine as the background, with GPUI drawing the cells.
The first batch of 3 runs was thrown out. macOS does not promise to bring a GUI program launched from the command line without an app bundle to the front; once its window is covered, GPUI and GhosttyKit both stop rendering, and the same scenario split into two clusters, for example P2 idle at 284 MiB once and 58 MiB another time. From then on the test windows used a floating window level, and any run with load but zero frames, or under 1% CPU, was marked invalid automatically. The 5 valid runs:
| Client | 1 pane, real Codex: memory / CPU | Idle: memory / CPU | 4 panes, real Codex | 4 panes, synthetic 100 KiB/s |
|---|---|---|---|---|
| Ghostty.app (reference) | 316 MiB / 9.8% | 76 MiB / 0.10% | not measured | not measured |
| P1 GPUI + alacritty | 287 MiB / 5.4% | 42 MiB / 0.80% | 327 MiB / 11.2% | 448 MiB / 20.6% |
| P2 Swift + GhosttyKit | 296 MiB / 3.4% | 58 MiB / 0.07% | 377 MiB / 8.3% | 536 MiB / 39.3% |
| P3 GPUI + libghostty-vt | 288 MiB / 5.9% | 42 MiB / 0.86% | 328 MiB / 13.2% | 374 MiB / 23.7% |
With one pane of real Codex output all three prototypes were within budget: GPUI used 0.91x Ghostty.app's memory and 0.55 to 0.60x its CPU, with p95 frame times of 1.6 to 1.9 ms and no frame over 16.7 ms. P1 and P3 were nearly identical, so the client's VT engine did not separate them; the framework did. With output, GPUI grew from 42 MiB idle to 287 MiB and Ghostty.app from 76 to 316, probably Metal frame buffers and glyph atlases, which were not broken down at the time.
The idle column is where GPUI missed: a GPUI window drawing nothing still used 0.8% CPU.
06 The surprise: idle GPUI used 8x Ghostty's CPU
0.80% against 0.10% is 8x Ghostty.app, above the 0.5% noise line. Reading the source and a sample profile showed why. In GPUI's macOS backend, while a window is visible a CVDisplayLink wakes it on every screen refresh to check invalidator.is_dirty(), whether or not anything needs drawing, and it only stops when the window is covered. Four panes in one window share a single display link, but that link never sleeps.
The fix was a GPUI patch: after a number of vsyncs with no new draw request, stop the display link; the moment the window is marked dirty, start it again so the next vsync draws. The core of the patch, simplified (locking and field setup removed):
// at the end of every vsync callback
if pause_idle {
if frame_demand {
idle_frames = 0;
} else {
idle_frames += 1;
if idle_frames >= idle_frames_limit {
stop_display_link();
paused_for_idle = true;
}
}
}
// when the window is marked dirty (the new frame_waker)
frame_demand = true;
idle_frames = 0;
if paused_for_idle {
paused_for_idle = false;
start_display_link();
}
The threshold matters. The first version paused after 3 frames: idle CPU dropped, and 4 panes of bursty output got worse.
| Scenario (P3, median of 5) | Unpatched | Patched, 3-frame threshold + 60 fps cap |
|---|---|---|
| Idle CPU | 0.86% | 0.07% (0.70x Ghostty.app) |
| 1 pane, real Codex, CPU | 5.9% | 7.4% |
| 4 panes, real Codex, CPU | 13.2% | 17.1% |
| 4 panes, real Codex, frame rate | 34 fps | 48 fps |
Agent output arrives in bursts. The display link kept stopping and restarting, and each restart drew a frame right away, splitting redraws that vsync used to merge into several frames. The 60 fps cap did nothing because the rate never reached 60. The direction worked; the threshold needed to be longer. It became the environment variable GPUI_PAUSE_IDLE_FRAMES, defaulting to 60 frames, about 0.5 s on a 120 Hz display. The 0.5 s setting had not been measured when the decision was made.
Comparing terminals yourself, with or without Fibo:
- Read memory as
phys_footprintwithfootprint, not RSS fromps; for a WebView include helpers such ascom.apple.WebKit.GPU. - Take CPU as the difference in cumulative CPU time over wall-clock time, not an instantaneous
topreading. - Keep the window under test in front and uncovered; many frameworks stop drawing a covered window, and you measure a false low.
- Start the reference terminal as a fresh instance with its own config (for Ghostty,
--config-default-files=false), not the one you use all day with many windows open.
# phys_footprint of one process at this moment, in bytes
footprint -f bytes -p <pid>
07 All four routes side by side
| Tauri + xterm.js | P1 GPUI + alacritty | P2 Swift + GhosttyKit | P3 GPUI + libghostty-vt | |
|---|---|---|---|---|
| Memory | 1029 MiB * | 287 MiB | 296 MiB | 288 MiB |
| CPU | 15% * | 5.4% | 3.4% | 5.9% |
| Idle | 0.3% when minimized | 42 MiB / 0.80% | 58 MiB / 0.07% | 42 MiB / 0.86%, 0.07% patched |
| 4 panes, real Codex | not measured | 327 MiB / 11.2% | 377 MiB / 8.3% | 328 MiB / 13.2% |
| esctest2 passes | 101 (alacritty in the background) | 101 | 147 | 147 |
| Chinese input | built into xterm.js, not tested | GPUI's IME interface, not tested | built into GhosttyKit, not tested | passed a hand test on the first build's day |
| Upkeep | reuses the Tauri code; needs a hand-written alacritty → xterm.js state mirror | GPUI patches; 1.29 GiB for 40 sessions in the background, no snapshots | the client carries its own full VT state; 536 MiB / 39% on 4 synthetic panes | a GPUI patch set to maintain; two dependencies pinned to commits; Zig in the build |
| Verdict | rejected: 3.56x memory, in the GPU process | control | fallback | chosen |
P2 had the lowest single-pane CPU, so why P3? Each route had one item that failed or was unknown: GPUI's idle CPU missed the line and needed a patch; P2 used the most resources under heavy 4-pane output, 15% more memory than GPUI on real Codex. The 4-pane Ghostty baseline was never measured, so neither could be judged against 1.2x. What decided it was structure:
- One engine at both ends: the background already keeps all state in libghostty-vt. P3's client parses again only for the 2 to 4 visible panes and attaches from a libghostty-vt snapshot, with no second implementation to keep in step.
- All Rust: background, protocol and window share types and code under one
cargotoolchain. GPUI also has a Linux backend, and Fibo'sCargo.tomlenables its x11 and wayland features on Linux. - The UI is ours to write anyway: overview cards and status bars have to be built either way, and GPUI's input handling (
NSTextInputClient, withbounds_for_rangeplacing the candidate window) was the most complete among the open frameworks; winit-based frameworks give the IME a single cursor rectangle.
On the afternoon of October 20 the testing stopped at the patch rerun, and the route was set as GPUI + libghostty-vt. Swift + GhosttyKit stayed as the fallback, with three written conditions, any one of which would reopen the question: an item on the Chinese input checklist fails and cannot be fixed within one iteration; the idle patch cannot be maintained (upstream reworks the display link and the patch has no replacement), or no threshold gives both idle ≤ 0.5% and unharmed 4-pane bursts; or a 4-pane baseline shows GPUI over 1.2x while P2 is not.
08 Chinese input: the one hard gate
When the route was chosen, none of the input-method checks had run; the prototypes had no IME at all. It was the only gate the evaluation called hard, and Zed had two open Chinese IME issues at the time (zed#59882, intermittent failure; zed#53537, shortcuts failing under third-party IMEs). So the first real build had to pass it the same day, or the plan would switch to P2.
How the first build does it: text being composed (marked text) lives only in the window's memory and never enters the PTY; it is drawn at the terminal cursor with an underline, and the terminal's own block cursor is hidden meanwhile. The candidate window's position comes from bounds_for_range, which uses the same measured font metrics as drawing and PTY resizing, with ranges converted as UTF-16 so surrogate pairs are never split. Measured Menlo cells were 7.525635 × 20 px; a Chinese character's advance was 15.051269 px against 15.051270 px for two cells, so wide characters align to two cells with no gap between them.
| Input check (10-20) | Result | How it was checked |
|---|---|---|
| Candidate window hugs the terminal cursor | pass | hand test with a third-party pinyin IME, real cat in the window |
| After switching between two panes, pinyin goes to the focused one | pass | same |
| A chosen word is committed once, nothing left over | pass | automated keystrokes n/i/h/a/o then Space, checked by screenshot |
| Return commits Latin letters; Backspace during composition only removes pinyin | pass | same |
| Spacing of Chinese, Japanese and Korean output | pass | screenshot of a real window |
Ctrl-C exits cat | fail | hand test; filed as a key-encoding bug and fixed in the next round |
The gate was passed and the fallback was not triggered. The record also states what was not covered: the full path with Apple's built-in pinyin got no valid evidence from the automated round (keys reached the window, but the system IME did not take over). Choosing words, Return and Backspace had been confirmed by hand in an earlier round, and the candidate window and pane switching were hand-tested with a third-party pinyin IME.
09 The price: a patch set, a month later
Choosing GPUI meant maintaining patches from the start. As of November 28, Fibo is still pinned to the versions the evaluation used, Zed v1.24.3 (2a857f5) and libghostty-rs 0ef8041, fetched and patched in order by bootstrap.sh. The one patch from the evaluation has become six:
| Patch | What it does | Lines |
|---|---|---|
gpui-idle | the idle display-link pause above; Fibo turns it on at startup (GPUI_PAUSE_IDLE_DISPLAY_LINK=1) | 89 |
gpui-retained-backbuffer | keeps the back buffer and redraws only what changed between frames, so a spinner repaints a few cells | 820 |
gpui-present-render-pass | copies the back buffer to the screen with a render pass instead of a blit: window graphics memory 408.4 → 248.4 MB, total about 570 → 385 MB | 110 |
gpui-retained-group-rects | merges several damaged regions into one Metal render pass | 189 |
gpui-fit-truncated-row | adds an ellipsis when text is cut off | 107 |
gpui-glyph-dilation | lets a run of text use a fixed glyph dilation instead of the color-based default; one place in Fibo's terminal drawing uses it to turn thickening off | 47 |
The six patch files add up to 1362 lines, most of it the retained back buffer. present-render-pass is a typical case: the first time a process used a blit, the Metal driver kept 20 extra 8 MB buffers and never returned them while the window kept drawing, and a minimal Metal program of a few dozen lines did the same. With a render pass instead, the screen buffer and back buffer matched byte for byte over 194 frames of a real window. Problems like this can be fixed at our own layer only because the framework is ours to patch; the cost is that every GPUI upgrade means reworking all six patches, which is why there has not been one.
To keep later changes from quietly undoing this, window redraw cost now has a CI gate: on real hardware it compares retired instructions per frame with a baseline and fails above 15% (CI's virtual machines cannot read instruction counts and fall back to ratio checks). Details are in the repository's docs/performance/.
Limits: what was not measured
- No 4-pane Ghostty baseline: splitting Ghostty.app into 4 panes needed automation permission and never happened. Whether 4 GPUI panes stay within 1.2x was unknown when the evaluation ended.
- No GPU time, power or input latency: the power script was written but not run; input latency only has a method.
- No real recording of Claude Code's full-screen redraws: only Codex was recorded; Claude Code's full-screen redraw exists only as a synthetic load.
- The 0.5 s idle threshold: not measured at decision time, and we found no later rerun under bursty 4-pane output for this post.
- The WebView runs were single: one run and one sample per scenario. At 3.5x the direction will not change, but the exact numbers carry error.
- The machine was busy: the evaluation's own rule voids a batch when the 1-minute load average exceeds 4; during measurement it was 8 to 26. Ratios were computed within a batch and CPU is cumulative, but absolute values run high.
- The raw data is not public: the evaluation's
results/, prototypes and scripts are in local commits of the old repository; the numbers here come from its summary tables and decision records.
Summary: three practices
- Turn "high performance" into a relative budget first: at most 1.2x Ghostty on the same machine and load, with memory counted only as
phys_footprint. That rule rejected the WebView route on a single pair of numbers, 1029 against 289 MiB. - Measure by layer, and pick the background and the window separately: 10 layers, 99 entries. libghostty-vt won the background on 405 MiB against 1.29 GiB, 66.5 MiB after compression and full snapshots; GPUI won the window on 0.91x memory and 0.55 to 0.60x CPU for one pane. The synthetic "1.9x slower" result was struck after a rerun on a real recording.
- A framework you can patch is one you keep patching: an 89-line patch took idle CPU from 0.8% to 0.07%; a month later there are 6 patches and 1362 lines, and GPUI is still pinned at v1.24.3. Chinese input was a hard gate with Swift kept as the fallback, and the first build passed it the same day.