mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-02-23 16:18:07 +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();
|
this.compileTerminfo();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// if (e.message === 'Terminal not found.') {
|
// If there was an error, fallback
|
||||||
this.term = 'vt102';
|
// to an internally stored terminfo/cap.
|
||||||
this.compileTermcap();
|
this._useXtermI();
|
||||||
// this.term = 'xterm';
|
|
||||||
// this.termcap = true;
|
|
||||||
// this.termcapFile = __dirname + '/../usr/xterm.termcap';
|
|
||||||
// this.compileTermcap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
* Terminfo
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user