From 685d7feb09897533e632bf0c465ce734c7ba5095 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 19 Mar 2015 04:16:59 -0700 Subject: [PATCH] fix tmux bypassing for cursor status. --- lib/program.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/program.js b/lib/program.js index 8cb50f8..a881ca9 100644 --- a/lib/program.js +++ b/lib/program.js @@ -1380,7 +1380,7 @@ Program.prototype._bindResponse = function(s) { } }; -Program.prototype.response = function(name, text, callback) { +Program.prototype.response = function(name, text, callback, noBypass) { var self = this; if (arguments.length === 2) { @@ -1414,7 +1414,9 @@ Program.prototype.response = function(name, text, callback) { return callback(new Error('Timeout.')); }, 2000); - return this._twrite(text); + return noBypass + ? this._write(text) + : this._twrite(text); }; Program.prototype._buffer = function(text) { @@ -2540,17 +2542,17 @@ Program.prototype.setBackground = function(color, val) { // CSI ? 5 3 n Locator available, if compiled-in, or // CSI ? 5 0 n No Locator, if not. Program.prototype.dsr = -Program.prototype.deviceStatus = function(param, callback, dec) { +Program.prototype.deviceStatus = function(param, callback, dec, noBypass) { if (dec) { return this.response('device-status', - '\x1b[?' + (param || '0') + 'n', callback); + '\x1b[?' + (param || '0') + 'n', callback, noBypass); } return this.response('device-status', - '\x1b[' + (param || '0') + 'n', callback); + '\x1b[' + (param || '0') + 'n', callback, noBypass); }; Program.prototype.getCursor = function(callback) { - return this.deviceStatus(6, callback); + return this.deviceStatus(6, callback, false, true); }; Program.prototype.saveReportedCursor = function(callback) {