add extended xterm features.

This commit is contained in:
Christopher Jeffrey 2013-03-06 04:27:42 -06:00
parent e2621f4025
commit 42815f72fa
2 changed files with 37 additions and 0 deletions

View File

@ -973,6 +973,36 @@ Program.prototype.setTitle = function(title) {
return this.osc('0;' + title + '\x07');
};
// OSC Ps ; Pt ST
// OSC Ps ; Pt BEL
// Reset colors
Program.prototype.resetColors = function(param) {
if (this.tput && this.tput.Cr) {
return this.put.Cr(param);
}
return this.osc('112;' + param + '\x07');
};
// OSC Ps ; Pt ST
// OSC Ps ; Pt BEL
// Change dynamic colors
Program.prototype.dynamicColors = function(param) {
if (this.tput && this.tput.Cs) {
return this.put.Cs(param);
}
return this.osc('12;' + param + '\x07');
};
// OSC Ps ; Pt ST
// OSC Ps ; Pt BEL
// Sel data
Program.prototype.selData = function(a, b) {
if (this.tput && this.tput.Ms) {
return this.put.Ms(a, b);
}
return this.osc('52;' + a + ';' + b + '\x07');
};
/**
* CSI
*/
@ -1062,6 +1092,7 @@ Program.prototype.eraseInDisplay = function(param) {
param = 0;
break;
}
// extended tput.E3 = ^[[3;J
return this.put.ed(param);
}
switch (param) {
@ -2264,6 +2295,10 @@ Program.prototype.setCursorStyle = function(param) {
param = '6';
break;
}
// extended tput.Se for param=2
if (this.tput && this.tput.Ss) {
return this.put.Ss(param);
}
return this.write('\x1b[' + (param || 1) + ' q');
};

View File

@ -12,10 +12,12 @@
// $ tic -a -1 usr/xterm.terminfo
// $ tic -a -1 usr/xterm.terminfo && ls ~/.terminfo
// $ tic -a -1 -o usr usr/xterm.terminfo && mv usr/x/xterm usr/ && rm -rf usr/v usr/x
// $ tic -a -1 -o usr usr/xterm.terminfo && mv usr/x/xterm-256color usr/ && rm -rf usr/v usr/x
// Check tput output:
// $ node test/tput.js xterm | tee out
// $ node test/tput.js xterm --ifile usr/xterm | tee out
// $ node test/tput.js xterm-256color --ifile usr/xterm-256color | tee out
// $ node test/tput.js vt102 --termcap | tee out
// $ node test/tput.js xterm --termcap --cfile usr/xterm.termcap | tee out
// $ node test/tput.js xterm --iprefix ~/.terminfo | tee out