add workaround for screen-256color terminfo. use correct terminfo fallback.
This commit is contained in:
parent
8f0025c650
commit
8cca60beac
11
lib/tput.js
11
lib/tput.js
|
@ -84,7 +84,7 @@ Tput.prototype._useXtermC = function() {
|
|||
Tput.prototype._useXtermI = function() {
|
||||
this.term = 'xterm';
|
||||
this.termcap = false;
|
||||
this.terminfoFile = __dirname + '/../usr/xterm.terminfo';
|
||||
this.terminfoFile = __dirname + '/../usr/xterm';
|
||||
this.compileTerminfo();
|
||||
};
|
||||
|
||||
|
@ -225,6 +225,15 @@ Tput.prototype.parseTerminfo = function(data) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Workaround: fix an odd bug in the screen-256color terminfo where it tries
|
||||
// to set -1, but it appears to have {0xfe, 0xff} instead of {0xff, 0xff}.
|
||||
// TODO: Possibly handle errors gracefully below, as well as in the
|
||||
// extended info. Also possibly do: `if (info.strings[key] >= data.length)`.
|
||||
if (info.strings[key] === 65534) {
|
||||
delete info.strings[key];
|
||||
return;
|
||||
}
|
||||
|
||||
var s = i + info.strings[key]
|
||||
, j = s;
|
||||
|
||||
|
|
Loading…
Reference in New Issue