« get me outta code hell

Make use of xterm alternate screen - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-01-25 09:10:37 -0400
committerFlorrie <towerofnix@gmail.com>2019-01-25 09:10:37 -0400
commit94e78b32499c71db1e32262e4edbfc3ebc4b120b (patch)
tree7fbf42f2cc64222fa2be2eb73d0ab668da410a58
parent5762a825d589704a53aaabb425d9470c726bbc0d (diff)
Make use of xterm alternate screen
..so that your scrollback isn't messed up by mtui's output when you
quit.
-rwxr-xr-xindex.js2
m---------tui-lib0
2 files changed, 2 insertions, 0 deletions
diff --git a/index.js b/index.js
index c366ed7..e46bfa0 100755
--- a/index.js
+++ b/index.js
@@ -44,6 +44,7 @@ async function main() {
 
   appElement.on('quitRequested', () => {
     process.stdout.write(ansi.cleanCursor())
+    process.stdout.write(ansi.disableAlternateScreen())
     process.exit(0)
   })
 
@@ -67,6 +68,7 @@ async function main() {
   root.h = size.height
   root.fixAllLayout()
 
+  process.stdout.write(ansi.enableAlternateScreen())
   process.stdout.write(ansi.startTrackingMouse())
 
   const flushable = new Flushable(process.stdout, true)
diff --git a/tui-lib b/tui-lib
-Subproject 0c38fb468621b3860fc9c7deb12ae464c57996e
+Subproject 6ca4f2e08d323b26940704eca89bdc71b4ed016