From e6b723f6937296cd2f0198cf04b1b28fe9cf14e5 Mon Sep 17 00:00:00 2001 From: HeavyGee <133152184+heavygee@users.noreply.github.com> Date: Thu, 11 Jun 2026 02:10:54 +0100 Subject: [PATCH] feat(web): auto-focus terminal on open (#876) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the terminal page loaded, focus stayed on the page body — the user had to click/tap into the xterm area before keystrokes were captured. Add terminal.focus() at the end of handleTerminalMount so focus lands inside the terminal as soon as the xterm instance is attached to the DOM. The quick-input buttons already call terminalRef.current?.focus() after each press; this extends the same pattern to the initial mount. Closes #875 Co-authored-by: Cursor --- web/src/routes/sessions/terminal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/src/routes/sessions/terminal.tsx b/web/src/routes/sessions/terminal.tsx index dd0a0b4f..0339145b 100644 --- a/web/src/routes/sessions/terminal.tsx +++ b/web/src/routes/sessions/terminal.tsx @@ -264,6 +264,7 @@ export default function TerminalPage() { const modifierState = modifierStateRef.current dispatchSequence(data, modifierState) }) + terminal.focus() }, [dispatchSequence] )