mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-02-22 23:58:09 +00:00
handle terminfo fallback better.
This commit is contained in:
parent
87ffe00a06
commit
962a7bdcc6
34
lib/tput.js
34
lib/tput.js
@ -51,16 +51,36 @@ function Tput(options) {
|
||||
this.compileTerminfo();
|
||||
}
|
||||
} catch (e) {
|
||||
// if (e.message === 'Terminal not found.') {
|
||||
this.term = 'vt102';
|
||||
this.compileTermcap();
|
||||
// this.term = 'xterm';
|
||||
// this.termcap = true;
|
||||
// this.termcapFile = __dirname + '/../usr/xterm.termcap';
|
||||
// this.compileTermcap();
|
||||
// If there was an error, fallback
|
||||
// to an internally stored terminfo/cap.
|
||||
this._useXtermI();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fallback
|
||||
*/
|
||||
|
||||
Tput.prototype._useVt102C = function() {
|
||||
this.term = 'vt102';
|
||||
this.termcap = true;
|
||||
this.compileTermcap();
|
||||
};
|
||||
|
||||
Tput.prototype._useXtermC = function() {
|
||||
this.term = 'xterm';
|
||||
this.termcap = true;
|
||||
this.termcapFile = __dirname + '/../usr/xterm.termcap';
|
||||
this.compileTermcap();
|
||||
};
|
||||
|
||||
Tput.prototype._useXtermI = function() {
|
||||
this.term = 'xterm';
|
||||
this.termcap = false;
|
||||
this.terminfoFile = __dirname + '/../usr/xterm.terminfo';
|
||||
this.compileTerminfo();
|
||||
};
|
||||
|
||||
/**
|
||||
* Terminfo
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user