Skip to content

Commit ae68b7c

Browse files
committed
Fix terminal sizing
The screen needs to be retrieved after opening the terminal in the container.
1 parent eb6bdf2 commit ae68b7c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

web/src/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ const toggleScroll = document.querySelector('#toggle-scroll');
2424
/** @type {HTMLDivElement} */
2525
const termContainer = document.querySelector('#xterm-container');
2626

27-
const termScreen = termContainer.querySelector('.xterm-screen');
28-
2927
/** @type {HTMLElement} */
3028
const termView = document.querySelector('#term-view');
3129

@@ -464,6 +462,9 @@ term.loadAddon(new WebLinksAddon());
464462
term.open(termContainer);
465463
fitAddon.fit();
466464

465+
// It should be safe to get the screen here after opening the terminal in the container
466+
const termScreen = termContainer.querySelector('.xterm-screen');
467+
467468
/** @type {Number} */
468469
let tid;
469470

0 commit comments

Comments
 (0)