fix: refocus terminal on window focus

Ctrl input can stop working if the browser window loses focus. Add a
window focus listener to re-focus the terminal whenever the window is
activated, restoring keyboard modifiers without requiring a reload.
This commit is contained in:
GitHub Copilot
2026-01-29 22:43:30 +00:00
parent 7b215beb2a
commit 54232c04c6
2 changed files with 6 additions and 1 deletions
File diff suppressed because one or more lines are too long
+5
View File
@@ -608,6 +608,11 @@ class WebTerminal {
this.terminal.focus(); this.terminal.focus();
} }
}); });
// Restore focus when browser window regains focus
window.addEventListener("focus", () => {
this.terminal.focus();
});
} }
/** Setup mobile keyboard input via hidden textarea */ /** Setup mobile keyboard input via hidden textarea */