diff --git a/lib/program.js b/lib/program.js index 8d04510..37935d2 100644 --- a/lib/program.js +++ b/lib/program.js @@ -872,7 +872,7 @@ Program.prototype._bindResponse = function(s) { // Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI // ? r ; c R (assumes page is zero). if (parts = /^\x1b\[(\?)?(\d+);(\d+)R/.exec(s)) { - out.event = 'device-status-report'; + out.event = 'device-status'; out.code = 'DSR'; out.type = 'cursor-status'; @@ -1158,35 +1158,6 @@ Program.prototype._bindResponse = function(s) { } }; -Program.prototype.receive = function(text, callback) { - var listeners = (this._events && this._events['keypress']) || [] - , bak = listeners.slice() - , self = this; - - if (!this.input.isRaw) { - throw new Error('Input must be raw.'); - } - - listeners.length = 0; - - if (!callback) { - callback = text; - text = null; - } - - this.input.once('data', function(data) { - listeners.push.apply(listeners, bak); - if (typeof data !== 'string') { - data = data.toString('utf8'); - } - return callback(null, data); - }); - - if (text != null) { - return this._write(text); - } -}; - Program.prototype.response = function(name, text, callback) { if (arguments.length === 2) { callback = text; diff --git a/test/program-mouse.js b/test/program-mouse.js index b5daa0f..1919a7c 100644 --- a/test/program-mouse.js +++ b/test/program-mouse.js @@ -35,3 +35,7 @@ program.on('keypress', function(ch, data) { program.cup(0, 0); console.log(data); }); + +// program.getCursor(function(err, data) { +// console.log(data); +// });