Properly set the tty cols and rows
This commit is contained in:
12
index.js
12
index.js
@ -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)
|
||||||
}
|
}
|
Reference in New Issue
Block a user