mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(web): auto-focus terminal on open (#876)
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 <cursoragent@cursor.com>
This commit is contained in:
@@ -264,6 +264,7 @@ export default function TerminalPage() {
|
||||
const modifierState = modifierStateRef.current
|
||||
dispatchSequence(data, modifierState)
|
||||
})
|
||||
terminal.focus()
|
||||
},
|
||||
[dispatchSequence]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user