This commit is contained in:
Christopher Jeffrey 2013-02-07 12:36:26 -06:00
parent 9020f645af
commit 48d7d73116

View File

@ -1077,14 +1077,13 @@ Program.prototype.text = function(text, attr) {
Program.prototype._attr = function(param, val) { Program.prototype._attr = function(param, val) {
var self = this var self = this
, parts = param.split(/\s*[,;]\s*/) , parts = param.split(/\s*[,;]\s*/);
, out = '';
if (parts.length > 1) { if (parts.length > 1) {
parts.forEach(function(part) { parts = parts.map(function(part) {
out += self._attr(part, val); return self._attr(part, val).slice(2, -1);
}); });
return out; return '\x1b[' + parts.join(';') + 'm';
} }
if (param.indexOf('no ') === 0) { if (param.indexOf('no ') === 0) {
@ -1267,10 +1266,9 @@ Program.prototype._attr = function(param, val) {
// non-16-color rxvt default fg and bg // non-16-color rxvt default fg and bg
case 'default fg bg': case 'default fg bg':
if (this.term('rxvt')) { return this.term('rxvt')
return '\x1b[100m'; ? '\x1b[100m'
} : '\x1b[39;49m';
return this._attr('default fg') + this._attr('default bg');
default: default:
// 256-color fg and bg // 256-color fg and bg
@ -1737,7 +1735,7 @@ Program.prototype.normalBuffer = function() {
}; };
Program.prototype.enableMouse = function() { Program.prototype.enableMouse = function() {
if (this.term('urxvt')) { if (this.term('rxvt')) {
return this.setMouse({ urxvtMouse: true }); return this.setMouse({ urxvtMouse: true });
} }