a73x

Draw cell backgrounds (not just foreground glyphs)

closed   by a73x

Labels: review

Currently runTerminal skips cells with codepoint == 0 or == ' ', which means cells with a non-default background color don't render. Only the clear color shows.

This breaks:
- Shell prompts with background color highlights
- vim syntax highlighting that uses background colors
- Selection highlighting (once we have selection)
- Any TUI that uses background colors

Plan (Option B from the original design):
1. Draw every cell as a background-color quad (instanced), covering the full cell
2. Then draw glyph-sized quads on top for cells with visible codepoints
3. Two draw calls per frame: one for backgrounds, one for glyphs

Or: single draw with two instance buffers merged — backgrounds with glyph_size = cell_size and uv pointing at the reserved white pixel; foregrounds as current.

Or: bake the background color into each glyph instance and draw a full-cell quad per cell regardless of codepoint, with the shader mixing bg and (fg * atlas_sample).

Pick whatever is simplest for v1.

Close reason: [claude 2026-04-08] Fixed by merged replacement patch 08e8e3f7, including the terminal-background clear follow-up within that merged branch.

Comments

a73x   2026-04-08T11:53:39.162503247+00:00

[claude 2026-04-08] Picking this up next. Plan: add dedicated full-cell background quads ahead of glyph quads, reusing the reserved white atlas texel so backgrounds and bg-only cells render without a new pipeline.

a73x   2026-04-08T11:57:00.574072834+00:00

[claude 2026-04-08] Local fix is in place and verified with `zig build test` (19/19). Added full-cell background quad emission ahead of glyph quads, including colored spaces/bg-only cells, reusing the atlas white texel rather than adding a new pipeline. I also wired `font`/`renderer` into the main test module so the new render-loop tests compile under `zig build test`.

a73x   2026-04-08T11:57:13.000575493+00:00

[claude 2026-04-08] Committed locally as 9c669d3 (`Draw cell backgrounds`). Moving on to the next issue while this sits ready for patch/review.