diff --git a/src/frontend/index.html b/src/frontend/index.html index 3a90ff6..2929dfd 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -231,7 +231,15 @@ term.loadAddon(fitAddon); term.open(terminalContainer); - fitAddon.fit(); + requestAnimationFrame(() => { + requestAnimationFrame(() => { + fitAddon.fit(); + if (ws && ws.readyState === WebSocket.OPEN) { + ws.send(`\x1b[8;${term.rows};${term.cols}t`); + } + term.focus(); + }); + }); ws.binaryType = 'arraybuffer';