From be89fc3518b9a13a2f8c63655eb81fb69fdf686b Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Wed, 29 Apr 2026 22:40:11 -0400 Subject: [PATCH] Keep fitted terminal bottom row visible Co-authored-by: Orca --- mobile/src/terminal/TerminalWebView.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/src/terminal/TerminalWebView.tsx b/mobile/src/terminal/TerminalWebView.tsx index e2461ce8180..4065f650326 100644 --- a/mobile/src/terminal/TerminalWebView.tsx +++ b/mobile/src/terminal/TerminalWebView.tsx @@ -309,7 +309,10 @@ const XTERM_HTML = ` var vpWidth = window.innerWidth; var vpHeight = window.innerHeight; var cols = Math.floor(vpWidth / cellWidth); - var rows = Math.floor(vpHeight / cellHeight); + // Why: Android WebView can report a viewport that is a little taller than + // the visibly unobscured terminal area next to the native input chrome. + // Reserve one row so max scroll leaves the final line fully visible. + var rows = Math.max(8, Math.floor(vpHeight / cellHeight) - 1); notify({ type: 'measure-result', cols: cols, rows: rows }); }