fix tmux bypassing for cursor status.

This commit is contained in:
Christopher Jeffrey 2015-03-19 04:16:59 -07:00
parent cbcc7e6124
commit 685d7feb09
1 changed files with 8 additions and 6 deletions

View File

@ -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) {