#1023·ink

Incremental rendering does not repaint when a terminal height shrink makes the frame fill the viewport

Author: costajohntCreated Sep 20, 2026Updated Sep 20, 2026

With incrementalRendering: true, shrinking the terminal so that the current frame exactly fills the new viewport (for example a 6-line frame while rows go from 10 to 6) writes no lines at all, only cursor movement.

When the terminal loses rows it scrolls just enough to keep the cursor on screen. Ink parks the cursor on the row below the frame, so as soon as the frame fills the new viewport the top row goes into scrollback. Ink re-renders on the resize, and because outputHeight >= rows the frame now goes out without its trailing newline. Every visible line is identical to the previous frame though, so the incremental log-update diff finds nothing to rewrite and emits cursorUp plus one cursorNextLine per unchanged line. The display stays shifted by one row and log-update's idea of where the frame sits is off by one from then on. The standard renderer is fine here: its eraseLines walks up over the frame and the newline row and rewrites everything.

javascript
const stdout = createStdout(40);
stdout.rows = 10;
render(<Box flexDirection="column">{lines.map(l => <Text key={l}>{l}</Text>)}</Box>, {stdout, incrementalRendering: true}); // 6 lines
stdout.rows = 6;
stdout.emit('resize');

Output on master: "\u001b[6A\u001b[E\u001b[E\u001b[E\u001b[E\u001b[E" (cursor moves only, nothing rewritten).

Expected: an erase and a rewrite of the frame, like the standard renderer does ("\u001b[2K\u001b[1A...\u001b[2K\u001b[Gline 0\nline 1\n...line 5").

A shrink that leaves the frame below the viewport height (say rows 10 to 8 with the same 6 lines) is not affected: the terminal does not scroll in that case, so skipping the unchanged frame is correct for both renderers.

Reproduced on master (d661543).