diff --git a/src/js/commands.ts b/src/js/commands.ts index fce3fdc..8e9d043 100644 --- a/src/js/commands.ts +++ b/src/js/commands.ts @@ -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 void | Promi document.body.dataset.mode = mode resize() autoScroll() + focusInput() }, reload: () => window.location.reload(), } diff --git a/src/js/focus.ts b/src/js/focus.ts index be59fd3..03f2a7e 100644 --- a/src/js/focus.ts +++ b/src/js/focus.ts @@ -5,7 +5,7 @@ import { cmdInput } from "./dom" export function initFocus() { window.addEventListener("click", focusHandler) - setTimeout(() => focusInput(), 10) + focusInput() } export function focusInput() {