Subtract one cell-height padding from viewport to prevent bottom row clipping

Math.floor(vpHeight / cellHeight) can produce a row count where the
last row's bottom edge aligns exactly with the container boundary,
causing it to be partially hidden. Subtracting one cellHeight before
dividing guarantees one full row of breathing room.

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo-H
2026-04-30 18:03:57 -04:00
co-authored by Orca
parent 856fec166e
commit 7cc3ea9fff
+5 -1
View File
@@ -316,7 +316,11 @@ const XTERM_HTML = `<!DOCTYPE html>
? containerHeightPx
: window.innerHeight;
var cols = Math.floor(vpWidth / cellWidth);
var rows = Math.max(8, Math.floor(vpHeight / cellHeight));
// Why: subtract one cellHeight of padding before dividing, so the
// last row never clips against the container's bottom edge. Without
// this, Math.floor can produce a row count where the final row's
// bottom pixels sit right at or past the visible boundary.
var rows = Math.max(8, Math.floor((vpHeight - cellHeight) / cellHeight));
notify({ type: 'measure-result', cols: cols, rows: rows });
}