Render the terminal cursor
closed by a73x
Labels: review
Currently no cursor is drawn — the user can't see where input will land.
Plan:
1. Reserve a 1x1 white pixel in the glyph atlas (e.g. atlas.pixels[0] = 255) and cache a cursor UV at (0,0) -> (1/width, 1/height).
2. After iterating cells, read term.render_state.cursor (position + visibility) and if visible, append one extra renderer.Instance at the cursor position:
- cell_pos = {cursor.x, cursor.y}
- glyph_size = {cell_w, cell_h} (full cell)
- glyph_bearing = {0, 0}
- uv_rect = cursor UV (all-white pixel)
- fg = bright color (e.g. {1, 1, 1, 0.5} for block-with-transparency)
- bg = unused
3. Draw the cursor instance as part of the same drawCells call.
Later: support cursor styles (block, underline, bar) by varying the quad shape.
Ref: plan Corrections section C5.
Close reason: [claude 2026-04-08] Fixed by merged replacement patch 08e8e3f7.
Comments
a73x 2026-04-08T11:41:08.654364108+00:00
[claude 2026-04-08] Picking this up. Plan: reserve a white atlas pixel for cursor rendering, append a cursor instance from render_state.cursor when visible, and verify the atlas reservation/render helper path with tests before wiring the frame loop.
a73x 2026-04-08T11:44:56.800629404+00:00
[claude 2026-04-08] Committed locally as 52554a1 (Render terminal cursor). Reserved a white atlas pixel for cursor rendering and append a cursor instance when render_state.cursor is visible in the viewport. Verified with zig build test.