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 in | Rule in the flagship |
|---|---|---|
| enter raw mode without wrecking the shell | Week 1 | TUI Restoration §1 |
| survive a panic while the terminal is in raw mode | Week 1 | TUI Restoration §1 |
keep stdout clean so a shell widget can read it | Week 1 | — |
| anchor an inline TUI to the row it launched on | Week 1 | TUI Restoration §7 |
| survive a terminal resize without warping the layout | Week 1 | — |
avoid the ?1049l cursor warp on VTE terminals | Week 1 | TUI Restoration §2 |
| move hardcoded strings, colours and layout into specs | Week 2 | Agentic Dev Patterns §2 |
| add a UI language without touching the code | Week 2 | Agentic Dev Patterns §2 |
| record a Wayland popup for a demo or a doc | Week 2 | — |
| golden-test what a terminal actually painted | Week 2 | The Golden-Change Playbook |
| render more rows than the terminal has | Week 3 | — |
| compile PNG art into terminal block characters | Week 3 | — |
| stop a per-pixel warning from firing 2,000 times | Week 3 | — |
| fit a grid to the terminal width without gutters | Week 3 | TUI Restoration §8 |
| stay responsive while the glyph rasterizer lags | Week 4 | — |
| stop split mouse events from typing into the search box | Week 4 | TUI Restoration §4 |
intercept :q before the search engine sees it | Week 4 | — |
| kill a duplicate implementation of your own program | Week 4 | Manifesto §5 |
| pick readable title text on any desktop theme | Week 5 | — |
| draw a full-width row without erasing its last cell | Week 5 | TUI Restoration §5 |
| get keystroke-to-results latency under 1 ms | Week 5 | — |
| move a spec format from JSON to YAML mid-project | Week 5 | Agentic Dev Patterns §2 |
| break up a 4,800-line source file | Week 6 | Agentic Dev Patterns §3 |
dispatch keys without a growing if-else chain | Week 6 | — |
| verify a TUI from a script, with no human eyes | Week 2 | TUI Restoration §6 |
| start a brand-new Zig TUI from nothing | Appendix | Canary-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
?1049lcursor warp), Week 4 (the split SGR read), Week 5 (the pending-wrap erase). Three bugs, told as they were lived.