Properly set the tty cols and rows

This commit is contained in:
2021-04-27 15:25:29 +02:00
parent 756bd61c3f
commit 76a68a75f1

View File

@ -110,11 +110,19 @@ function onConsoleLine(line) {
previous_line = line; previous_line = line;
} }
// Fit xterm to the container on window resize // Resize the terminal
window.addEventListener("resize", () => { window.addEventListener("resize", () => {
termfit.fit() resize();
}) })
function resize() {
// Resize the terminal
termfit.fit();
// Send tty resize over /dev/console so that the user can't see it
emulator.keyboard_send_text(`stty cols ${term.cols} rows ${term.rows} -F /dev/ttyS0\n`)
}
function debug(text) { function debug(text) {
console.debug("DEBUG: "+text) console.debug("DEBUG: "+text)
} }