diff options
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/index.js b/index.js index ca62f17..b46edb6 100644 --- a/index.js +++ b/index.js @@ -23,8 +23,7 @@ async function main() { const size = await interfacer.getScreenSize() const flushable = new Flushable(process.stdout, true) - flushable.screenLines = size.lines - flushable.screenCols = size.cols + flushable.resizeScreen(size) flushable.shouldShowCompressionStatistics = process.argv.includes('--show-ansi-stats') flushable.write(ansi.clearScreen()) flushable.flush() @@ -33,6 +32,13 @@ async function main() { root.w = size.width root.h = size.height + interfacer.on('resize', newSize => { + root.w = newSize.width + root.h = newSize.height + flushable.resizeScreen(newSize) + root.fixAllLayout() + }) + const appElement = new AppElement() root.addChild(appElement) root.select(appElement) |