Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Recipe Index

This chronicle is organised by date, which is the one axis nobody ever queries. This chapter is the other axis.

Every row below is a problem somebody actually hit while building emojig, the week that paid for it, and — where one exists — the rule it hardened into over in the field manual. This is a jump table, not a cookbook: it deliberately contains no code. A second copy of the technique would drift away from the week that owns it, which is precisely the failure Week 4 spent a day deleting. Follow the link, read the week, take the code from there.

Blank cells in the right-hand column are informative. They mark techniques this project learned and the flagship never captured — candidates for the field manual, not for duplication here.

I need to…

I need to…Lived inRule in the flagship
enter raw mode without wrecking the shellWeek 1TUI Restoration §1
survive a panic while the terminal is in raw modeWeek 1TUI Restoration §1
keep stdout clean so a shell widget can read itWeek 1—
anchor an inline TUI to the row it launched onWeek 1TUI Restoration §7
survive a terminal resize without warping the layoutWeek 1—
avoid the ?1049l cursor warp on VTE terminalsWeek 1TUI Restoration §2
move hardcoded strings, colours and layout into specsWeek 2Agentic Dev Patterns §2
add a UI language without touching the codeWeek 2Agentic Dev Patterns §2
record a Wayland popup for a demo or a docWeek 2—
golden-test what a terminal actually paintedWeek 2The Golden-Change Playbook
render more rows than the terminal hasWeek 3—
compile PNG art into terminal block charactersWeek 3—
stop a per-pixel warning from firing 2,000 timesWeek 3—
fit a grid to the terminal width without guttersWeek 3TUI Restoration §8
stay responsive while the glyph rasterizer lagsWeek 4—
stop split mouse events from typing into the search boxWeek 4TUI Restoration §4
intercept :q before the search engine sees itWeek 4—
kill a duplicate implementation of your own programWeek 4Manifesto §5
pick readable title text on any desktop themeWeek 5—
draw a full-width row without erasing its last cellWeek 5TUI Restoration §5
get keystroke-to-results latency under 1 msWeek 5—
move a spec format from JSON to YAML mid-projectWeek 5Agentic Dev Patterns §2
break up a 4,800-line source fileWeek 6Agentic Dev Patterns §3
dispatch keys without a growing if-else chainWeek 6—
verify a TUI from a script, with no human eyesWeek 2TUI Restoration §6
start a brand-new Zig TUI from nothingAppendixCanary-First Development

Reading paths

Three ways through this book that are not “front to back”:

  • I am building a terminal UI. Week 1 (teardown, /dev/tty), Week 3 (virtualization), Week 5 (contrast, latency), then the Appendix as a checklist.
  • I am organising an agentic project. Week 2 (specs), Week 4 (deleting the clone), Week 6 (decomposition) — and skip the rendering weeks entirely.
  • I want the failures. Week 1 (the ?1049l cursor warp), Week 4 (the split SGR read), Week 5 (the pending-wrap erase). Three bugs, told as they were lived.