Skip to content

Commit

Permalink
Replaced interactive mode tty API with readline (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Feb 26, 2019
1 parent 54a3377 commit ae1e495
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions signale.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit ae1e495

Please sign in to comment.