focus when ready

This commit is contained in:
Chris Wanstrath 2025-10-02 13:00:07 -07:00
parent c5eabe4a4d
commit 2a73d5630b
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import { resize } from "./resize"
import { autoScroll } from "./scrollback"
import { sessionId } from "./session"
import { send } from "./websocket"
import { focusInput } from "./focus"
export const commands: string[] = []
@ -27,6 +28,7 @@ export const browserCommands: Record<string, (...args: string[]) => void | Promi
document.body.dataset.mode = mode
resize()
autoScroll()
focusInput()
},
reload: () => window.location.reload(),
}

View File

@ -5,7 +5,7 @@ import { cmdInput } from "./dom"
export function initFocus() {
window.addEventListener("click", focusHandler)
setTimeout(() => focusInput(), 10)
focusInput()
}
export function focusInput() {