summaryrefslogtreecommitdiff
path: root/lib/tty.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2019-07-16 11:46:59 -0400
committercjihrig <cjihrig@gmail.com>2019-07-18 17:20:45 -0400
commitd0894773a404b04ffd2a050131e73a5622a591c6 (patch)
tree40c12e9e218e50e6f23e536f7663d000ecc6544c /lib/tty.js
parent3da44b0b52617556a1c3816a0ae9167a1848655f (diff)
downloadnode-new-d0894773a404b04ffd2a050131e73a5622a591c6.tar.gz
tty: expose stream API from readline methods
This commit exposes the return value and callback of the underlying readline APIs from the tty module. PR-URL: https://github.com/nodejs/node/pull/28721 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/tty.js')
-rw-r--r--lib/tty.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/tty.js b/lib/tty.js
index 9e7d7dbb31..cc22a3b499 100644
--- a/lib/tty.js
+++ b/lib/tty.js
@@ -137,21 +137,21 @@ WriteStream.prototype._refreshSize = function() {
};
// Backwards-compat
-WriteStream.prototype.cursorTo = function(x, y) {
+WriteStream.prototype.cursorTo = function(x, y, callback) {
if (readline === undefined) readline = require('readline');
- readline.cursorTo(this, x, y);
+ return readline.cursorTo(this, x, y, callback);
};
-WriteStream.prototype.moveCursor = function(dx, dy) {
+WriteStream.prototype.moveCursor = function(dx, dy, callback) {
if (readline === undefined) readline = require('readline');
- readline.moveCursor(this, dx, dy);
+ return readline.moveCursor(this, dx, dy, callback);
};
-WriteStream.prototype.clearLine = function(dir) {
+WriteStream.prototype.clearLine = function(dir, callback) {
if (readline === undefined) readline = require('readline');
- readline.clearLine(this, dir);
+ return readline.clearLine(this, dir, callback);
};
-WriteStream.prototype.clearScreenDown = function() {
+WriteStream.prototype.clearScreenDown = function(callback) {
if (readline === undefined) readline = require('readline');
- readline.clearScreenDown(this);
+ return readline.clearScreenDown(this, callback);
};
WriteStream.prototype.getWindowSize = function() {
return [this.columns, this.rows];