Fix example demo. (#506)

This commit is contained in:
Arthur Sonzogni (slow/sick) 2022-11-11 14:07:27 +01:00 committed by GitHub
parent dfdbe1eecf
commit 9babfea36b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,13 +92,16 @@
}
term.onBinary(onBinary);
term.onData(onBinary)
term.resize(140,43);
window.Module = {
preRun: () => {
FS.init(stdin, stdout, stderr);
},
postRun: [],
onRuntimeInitialized: () => {
// Handle screen resize:
if (window.Module._ftxui_on_resize == undefined)
return;
const fit_addon = new (FitAddon.FitAddon)();
term.loadAddon(fit_addon);
fit_addon.fit();