commit 45f8703305fe0f39b8a879c2cfd15416b08da386
parent 04bfb55d386b04013e063f2d9f2e76ef417f8c73
Author: Damian Myrda <damian@prime8.dev>
Date: Fri, 23 Oct 2026 07:35:25 +0000
web shell: a click anywhere below the top bar focuses the prompt
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/internal/web/scripts/modules/shell.js b/internal/web/scripts/modules/shell.js
@@ -790,7 +790,7 @@ export function initShell() {
render();
// The prompt takes focus only when asked: typing a letter (above) or a
- // click inside the terminal. It is never grabbed on load, on a tab switch
+ // click anywhere below the top bar. It is never grabbed on load, on a tab switch
// or on window focus, so the page shortcuts keep the keyboard by default.
// Touch screens are skipped, since focus pops the on-screen keyboard.
const finePointer = window.matchMedia("(pointer: fine)").matches;
@@ -808,7 +808,7 @@ export function initShell() {
}
shellHandlers.click = (e) => {
if (!section.isConnected || e.button !== 0) return;
- if (!section.contains(e.target)) return;
+ if (e.target.closest?.("header, #tabs")) return; // the top bar keeps its own clicks
if (e.target.closest?.("a, button, input, textarea, select, label, summary, [tabindex], #help-overlay")) return;
if (String(window.getSelection?.() || "")) return;
if (window.isLightboxOpen?.()) return;