From 8053f12b63e272cc9119a30f9ddc480b5ea75641 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 15 Sep 2019 17:17:31 -0300 Subject: Only render when stuff on-screen actually changes! This means we can basically guarantee 0% CPU usage when nothing on the screen is changing! There may still be some kinks to work out, but I've tested most features and fixed any apparent bugs (including an unrelated bug in the suspend feature which made it crash when resuming the process). --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 2b6978b..26f0fbb 100755 --- a/index.js +++ b/index.js @@ -67,9 +67,8 @@ async function main() { } }) - const { appElement, renderInterval } = await setupClient({ + const { appElement, dirtyTerminal, flushable, root } = await setupClient({ backend, - frameRate: 50, interfacer: new CommandLineInterfacer(), writable: process.stdout }) @@ -78,7 +77,6 @@ async function main() { if (telnetServer) { telnetServer.disconnectAllSockets('User closed mtui - see you!') } - clearInterval(renderInterval) process.exit(0) }) @@ -91,6 +89,7 @@ async function main() { process.stdin.setRawMode(false) process.stdin.setRawMode(true) dirtyTerminal() + root.renderNow() }) const loadPlaylists = async () => { -- cgit 1.3.0-6-gf8a5