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:
File diff suppressed because one or more lines are too long
@@ -608,6 +608,11 @@ class WebTerminal {
|
||||
this.terminal.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// Restore focus when browser window regains focus
|
||||
window.addEventListener("focus", () => {
|
||||
this.terminal.focus();
|
||||
});
|
||||
}
|
||||
|
||||
/** Setup mobile keyboard input via hidden textarea */
|
||||
|
||||
Reference in New Issue
Block a user