This commit is contained in:
Christopher Jeffrey 2013-02-07 12:36:26 -06:00
parent 9020f645af
commit 48d7d73116
1 changed files with 8 additions and 10 deletions

View File

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