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 }); }