« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
path: root/ui/Root.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/Root.js')
-rw-r--r--ui/Root.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ui/Root.js b/ui/Root.js
index b170f99..fc494a7 100644
--- a/ui/Root.js
+++ b/ui/Root.js
@@ -50,9 +50,7 @@ module.exports = class Root extends DisplayElement {
     // Render the cursor, based on the cursorX and cursorY of the currently
     // selected element.
     if (
-      this.selected &&
-      typeof this.selected.cursorX === 'number' &&
-      typeof this.selected.cursorY === 'number' &&
+      this.selected && this.selected.cursorVisible &&
       (Date.now() - this.cursorBlinkOffset) % 1000 < 500
     ) {
       writable.write(ansi.moveCursor(
@@ -61,7 +59,7 @@ module.exports = class Root extends DisplayElement {
       writable.write('I')
       writable.write(ansi.resetAttributes())
     }
-    writable.write(ansi.moveCursor(0, 0))
+    writable.write(ansi.hideCursor())
   }
 
   cursorMoved() {