mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-24 01:38:54 +00:00
try hex char representations for terminfo subdirectory. see #2.
This commit is contained in:
parent
a30d3ecbe8
commit
980e65bd2c
31
lib/tput.js
31
lib/tput.js
@ -163,22 +163,41 @@ Tput._tprefix =
|
||||
Tput.prototype._tprefix = function(prefix, term) {
|
||||
if (!prefix) return;
|
||||
|
||||
var file
|
||||
, ch;
|
||||
|
||||
if (!term) {
|
||||
file = path.resolve(prefix, 'x');
|
||||
try {
|
||||
fs.statSync(file);
|
||||
return prefix;
|
||||
} catch (e) {
|
||||
return;
|
||||
;
|
||||
}
|
||||
file = path.resolve(prefix, '78');
|
||||
try {
|
||||
fs.statSync(file);
|
||||
return prefix;
|
||||
} catch (e) {
|
||||
;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var file = path.resolve(
|
||||
prefix,
|
||||
path.basename(term[0]),
|
||||
path.basename(term)
|
||||
);
|
||||
term = path.basename(term);
|
||||
|
||||
file = path.resolve(prefix, term[0], term);
|
||||
try {
|
||||
fs.statSync(file);
|
||||
return file;
|
||||
} catch (e) {
|
||||
;
|
||||
}
|
||||
|
||||
ch = term[0].charCodeAt(0).toString(16);
|
||||
if (ch.length < 2) ch = '0' + ch;
|
||||
|
||||
file = path.resolve(prefix, ch, term);
|
||||
try {
|
||||
fs.statSync(file);
|
||||
return file;
|
||||
|
Loading…
x
Reference in New Issue
Block a user