fix: focus terminal when tab becomes visible

This commit is contained in:
GitHub Copilot
2026-01-29 21:55:20 +00:00
parent 204c662920
commit 1ec5b7402f
2 changed files with 8 additions and 1 deletions
File diff suppressed because one or more lines are too long
+7
View File
@@ -601,6 +601,13 @@ class WebTerminal {
// Connect WebSocket // Connect WebSocket
this.connect(); this.connect();
// Focus terminal when returning to the tab
document.addEventListener("visibilitychange", () => {
if (!document.hidden) {
this.terminal.focus();
}
});
} }
/** Setup mobile keyboard input via hidden textarea */ /** Setup mobile keyboard input via hidden textarea */