Merge pull request #4078 from Tyriar/fix_demo_resize

Fix resize on demo
This commit is contained in:
Daniel Imms
2022-08-27 20:52:16 -07:00
committed by GitHub
+5 -1
View File
@@ -406,7 +406,11 @@ function initOptions(term: TerminalType): void {
const input = <HTMLInputElement>document.getElementById(`opt-${o}`);
addDomListener(input, 'change', () => {
console.log('change', o, input.value);
if (o === 'lineHeight') {
if (o === 'rows') {
term.resize(term.cols, parseInt(input.value));
} else if (o === 'cols') {
term.resize(parseInt(input.value), term.rows);
} else if (o === 'lineHeight') {
term.options.lineHeight = parseFloat(input.value);
} else if (o === 'scrollSensitivity') {
term.options.scrollSensitivity = parseFloat(input.value);