fix: focus terminal when tab becomes visible
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user