fix: use double requestAnimationFrame to ensure terminal dimensions are stable before fitting
This commit is contained in:
@@ -231,7 +231,15 @@
|
|||||||
|
|
||||||
term.loadAddon(fitAddon);
|
term.loadAddon(fitAddon);
|
||||||
term.open(terminalContainer);
|
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';
|
ws.binaryType = 'arraybuffer';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user