diff options
author | Florrie <towerofnix@gmail.com> | 2018-12-08 03:18:50 -0400 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-12-08 03:18:50 -0400 |
commit | 99d2ed5b2f8bb39fa2517efd5a68dbb2b27b3121 (patch) | |
tree | 89bf164b48c88be1c90fe4aaaa1ccdbe81a8e79d | |
parent | 9ab92766dd225cdf6db0e465057f8f7fddddac28 (diff) |
Stop tracking mouse on cleanCursor()
This way when a program is exited, the mouse will go back to normal (so you can scroll the terminal log, etc).
-rw-r--r-- | util/ansi.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/ansi.js b/util/ansi.js index 860a4fa..e7f7642 100644 --- a/util/ansi.js +++ b/util/ansi.js @@ -48,7 +48,9 @@ const ansi = { cleanCursor() { // A combination of codes that generally cleans up the cursor. - return ansi.resetAttributes() + ansi.showCursor() + return ansi.resetAttributes() + + ansi.stopTrackingMouse() + + ansi.showCursor() }, hideCursor() { @@ -108,6 +110,10 @@ const ansi = { return `${ESC}[?1000h` }, + stopTrackingMouse() { + return `${ESC}[?1000l` + }, + requestCursorPosition() { // Requests the position of the cursor. // Expect a stdin-result '\ESC[l;cR', where l is the line number (1-based), |