37 posts
Engineering blog
How tuios and the tools around it were built, measured and fixed. Every number comes from a run you can repeat from the repository.
7 min read
A wait that made the pane 197 times slower
An agent that waits for output with tuios wait-for made a flooding pane three times slower. I fixed how often the wait looked. On the libghostty-vt backend the same test still said 197 times, because each look read the history one cell at a time.
7 min read
One fuzz failure was the test, one was the emulator
Two fuzz targets failed in tuios on the same evening. The kitty graphics target had an oracle that an allocator change left behind, and my first fix made it too lenient. FuzzModel found a real bug, a cut-off UTF-8 rune that ate the escape after it.
8 min read
Why your link click did nothing
The hover label in tuios said shift+click to open a link, and in most terminals shift+click never reached tuios. The fix moved the click to ctrl, sent every link to the outer terminal as OSC 8, and then got the Mac wrong once before it got it right.
7 min read
460 characters that draw nothing
tuios fences the text other programs write before an agent reads it. The fence removed 22 invisible characters. Tag characters, variation selectors and the line separator went through. What it removes now, and the one joiner it keeps.
8 min read
Crush reports to herdr, so tuios answers as herdr
Crush tells herdr when it works, waits and finishes, and Collie drives herdr through its socket. Neither knows tuios. How every tuios pane came to answer herdr's protocol, and what that cost.
7 min read
Three flaky tests, and what they were hiding
Nine tests failed now and then on CI in the last days of September. Two were product bugs, and the work turned up a third. A hook that waited on itself, a broken pipe that should have been an error, and a command line the shell echoed twice.
4 min read
tuios v0.8.0
The first release in six months. tuios now knows what the coding agents in your panes are doing, keeps your sessions in a daemon that brings them back, and runs panes on other machines.
8 min read
A window named db
An end-to-end test lost an agent's state about twice in a hundred runs. It was not a race. The pane was named db, db is hex, and -w tried a window id prefix before an exact name.
8 min read
Making the binary smaller, and the idea that made it bigger
Seven commits took the tuios release binary from 30.0 MB to 23.8 MB. A plan to leave screen saver data out of the binary made it 23.5 KB larger instead.
7 min read
TERM=dumb followed the session
A session created by a command with no terminal of its own gave every pane TERM=dumb for its whole life. A screenshot test found it by failing on CI with the same numbers every time.
8 min read
Tests that could not fail
A resize fuzzer whose only screen check sat behind a constant false, a palette test that measured the length of a fixed-size array, and a pinned repro that lost one byte to encoding/json. All three were green, and none of them could go red.
9 min read
Deleting two thirds of the unit tests, then putting a third back
In one day I cut the tuios unit tests from 4,239 to 1,470 under a strict rule, then restored 1,395 of them. The rule asked what kind of test it was. The review asked whether a bug gets past the E2E suite without it.
6 min read
The background vanished under a tab
Under tmux, a few cells beside the Inbox title showed the terminal's own background instead of the panel's. The bytes tuios sent were right. bubbletea moved the cursor with a hard tab, and tmux 3.6 and later keep that tab as one cell that a later write breaks.
12 min read
A full scrollback cost 232MB per pane, twice: once in the daemon and once in each client
A 112-byte cell made every scrollback line cost the full pane width. Packing cells, then storing lines as text, took a full ring from 232MB to 2.2MB.
16 min read
Agents drive tuios through one-shot commands, so the event bus could not reach them
A hub only reaches whoever is subscribed right now, and agents almost never are. How tuios got a mailbox, ask-agent and an inbox for the person.
15 min read
The pane ran on another machine, and ctrl+D waited for the next keypress
tuios daemons now talk to each other over one ssh link per machine. It shipped in stages, and each stage had a bug that taught me something.
17 min read
A PTY has one size, and two clients had two opinions about it
Two clients on one session each laid the panes out around their own chrome and fought over the shared shells. The fix, and the harness that found the rest.
8 min read
A session switch forgot my column widths
Switching sessions and back reset a widened column in the scrolling layout and split stacked panes apart, because the session state saved the strip's offset and not its columns. The same gap had two clients on one session drawing different widths.
11 min read
Most of a scroll was spent on blank cells
A ten-character line scrolling off a 207-column screen walked the whole row twice. One int per row cut the short-line scroll from 1,120 ns to 240 ns, measured on a machine that would not sit still.
10 min read
Nothing failed, so nothing was fixed
A whole-codebase audit of tuios found a flag nothing set, an interface with one implementation behind 140 call sites, and copies of code that had quietly drifted apart. Dead code survives because nothing fails when it is wrong.
13 min read
Session state was saved every 30 seconds and never read back
tuios wrote every session to disk from April and no daemon ever loaded it. Wiring up the read side, and then making reattached panes redraw correctly.
13 min read
The one moment an agent needed you was the one moment tuios could not see
A coding agent blocked on a permission prompt paints it once and goes silent. How tuios learned to tell that silence apart from a finished turn.
9 min read
The underline depended on which code drew it
A focused tuios pane dropped SGR underline, and some unfocused panes dropped almost every attribute. tuios had five ways to draw a pane and only one kept everything, so the text changed when focus moved.
3 min read
The screenshot cell was half measured and half guessed
Pane screenshots came out stretched. Two rounds of font maths got the cell shape wrong. The fix asks the host terminal for its real cell size in pixels.
3 min read
The renderer was drawing a backlog it had caused
A flooded tuios pane kept painting 1.2 s after its source exited. The client's own renderer caused the backlog, and pacing by queued bytes halved the tail.
7 min read
The fuzzer that found nothing, and the two questions that found everything
590,000 fuzz runs against the tuios terminal emulator found nothing, because they checked that the screen was well formed, not that it was right. Two properties that compare the emulator with itself found two real bugs.
5 min read
A fifth of every frame went to changing nothing
A profile put 19.8% of the tuios client in lipgloss.Wrap, rewrapping pane text already the right width. Skipping it was easy. Proving the skip safe was the work.
6 min read
My differential tests passed and the screen was pink
A style cache keyed by recycled libghostty-vt style IDs painted ls output hot pink, and a differential test suite that compared once, at the end, missed it.
8 min read
The daemon said yes to an option that did not exist
Driving the tuios control socket the way a program would found a command that lost its spaces, a parameter that was silently dropped, and 88 settings of which six applied live.
4 min read
My multiplexer lied about what it could do
kitty icat drew nothing when tuios ran in a browser client, because the graphics passthrough said yes to file transmission without asking the host.
8 min read
My fuzzer was optimising for my own bug
A flaky TUI fuzz suite came down to a PTY line discipline I never configured, and a shrinker that minimised straight toward the race.
9 min read
The benchmark said 27x faster. It felt worse.
Fixing pane resize lag in TUIOS with Go benchmarks and pprof. Two of four theories were wrong, and the benchmark measured the wrong thing for three rounds.
6 min read
Three terminal bugs in one month turned out to be one bug
Terminals answer queries like OSC 11 and CPR. Three bugs in three codebases were one bug: the reply was dropped, sent to the wrong place, or echoed back.
8 min read
I dragged one divider and five windows moved
Dragging one divider in the tuios tiling layout moved five windows. It was three defects: neighbours found by geometry, a restarting ease, a truncated ratio.
7 min read
The bug I closed three times: a speckled sprite in a WebGL terminal
A speckled sprite in the tuios browser terminal. Three wrong closures, a test suite blind by construction, and a browser that salted its own pixel readback.
5 min read
I ported a correct emoji width table and it fixed nothing
Emoji widths were wrong in the tuios browser client. I ported ghostty's per-codepoint width table and nothing changed, because a terminal gives width to grapheme clusters, not to codepoints.
6 min read
I shipped three fixes for a bug I had not found
A tuios pane went blank on focus changes. I shipped three real fixes for other bugs before I reproduced it, and the cause was a window width read from its first line.