From 7cc3ea9fff4152bfaaba01f428a96e94cc526e9c Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Thu, 30 Apr 2026 17:53:42 -0400 Subject: [PATCH] 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 --- mobile/src/terminal/TerminalWebView.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mobile/src/terminal/TerminalWebView.tsx b/mobile/src/terminal/TerminalWebView.tsx index d6672c4084a..c1fe7332467 100644 --- a/mobile/src/terminal/TerminalWebView.tsx +++ b/mobile/src/terminal/TerminalWebView.tsx @@ -316,7 +316,11 @@ const XTERM_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 }); }