From 99d2ed5b2f8bb39fa2517efd5a68dbb2b27b3121 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 8 Dec 2018 03:18:50 -0400 Subject: 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). --- util/ansi.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'util') 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), -- cgit 1.3.0-6-gf8a5