commit 8eda2ec4ed6531c39e16e1c624bfbaf7ec98cd5c parent 6411e211ecda32b92195fc74a32569b3a0759e71 Author: Damian Myrda <damian@prime8.dev> Date: Thu, 22 Oct 2026 00:35:26 +0000 web: shell prompt is focused on load (fine pointers only) Diffstat:
| M | internal/web/scripts/modules/shell.js | | | 8 | ++++++++ |
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/internal/web/scripts/modules/shell.js b/internal/web/scripts/modules/shell.js @@ -776,4 +776,12 @@ export function initShell() { if (!load(LOGIN_KEY)) store(LOGIN_KEY, String(Date.now())); render(); + + // A terminal opens focused. Skip touch screens, where focus pops the + // on-screen keyboard, and never steal focus from something else. + const active = document.activeElement; + const idle = !active || active === document.body || active === document.documentElement; + if (!live.hidden && idle && window.matchMedia("(pointer: fine)").matches) { + input.focus({ preventScroll: true }); + } }