From 912f58cc150a517a939db223fee0789cada5707f Mon Sep 17 00:00:00 2001 From: Klaus Sinani Date: Tue, 26 Feb 2019 23:40:21 +0200 Subject: [PATCH] Replaced interactive mode `tty` API with `readline` (#82) (#83) --- signale.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/signale.js b/signale.js index 802fe9a5..cb594807 100644 --- a/signale.js +++ b/signale.js @@ -1,6 +1,7 @@ 'use strict'; const util = require('util'); const path = require('path'); +const readline = require('readline'); const chalk = require('chalk'); const figures = require('figures'); const pkgConf = require('pkg-conf'); @@ -271,9 +272,9 @@ class Signale { _write(stream, message) { if (this._interactive && stream.isTTY && isPreviousLogInteractive) { - stream.moveCursor(0, -1); - stream.clearLine(); - stream.cursorTo(0); + readline.moveCursor(stream, 0, -1); + readline.clearLine(stream); + readline.cursorTo(stream, 0); } stream.write(message + '\n');