# libvterm resize adaptation

The pinned MIT-licensed libvterm 0.3.3 archive remains unchanged. `Screen.cmake`
generates a patched `screen.c` in the build directory and verifies the expected
source anchors before applying it. The original libvterm license is packaged.

Reflow remains enabled for completed primary-screen output. The logical line
containing the active cursor keeps its physical rows during resize, because
shells redraw that line using the previous row count. Alternate-screen rows
also stay under the application's control. This prevents duplicate prompts
and cursor movement caused by reflowing the shell's pending input twice.

This matches the cursor-line policy documented in
[xterm.js](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts)
(`reflowCursorLine`), reviewed 2026-10-16. No xterm.js implementation is copied.
Regression tests cover recorded shell redisplay, real Bash shrinking, completed
output reflow and alternate screens. Repeated real Zsh grow/shrink was also
checked. Bash 5.1 can leave a stale tail when growing a three-row command; the
same captured output reproduces that tail in xterm.js. That separate shell
redisplay limitation is not claimed fixed by this adaptation.
