commit
981de641ae
14
README.md
14
README.md
|
@ -53,8 +53,8 @@ box.on('click', function(data) {
|
|||
screen.render();
|
||||
});
|
||||
|
||||
// If box is focused, handle `enter` and give us some more content.
|
||||
box.key('enter', function() {
|
||||
// If box is focused, handle `enter`/`return` and give us some more content.
|
||||
box.key(['enter', 'return'], function(ch, key) {
|
||||
box.setContent('{right}Even different {black-fg}content{/black-fg}.{/right}\n');
|
||||
box.setLine(1, 'bar');
|
||||
box.insertLine(1, 'foo');
|
||||
|
@ -73,6 +73,16 @@ box.focus();
|
|||
screen.render();
|
||||
```
|
||||
|
||||
## Windows compatibility
|
||||
|
||||
Currently there is no mouse or 'resize' event support on Windows.
|
||||
|
||||
Windows users will need to explicitly set `term` when creating a screen like so:
|
||||
|
||||
``` js
|
||||
var screen = blessed.screen({ term: 'windows-ansi' });
|
||||
```
|
||||
|
||||
|
||||
## High-level Documentation
|
||||
|
||||
|
|
11
lib/tput.js
11
lib/tput.js
|
@ -73,6 +73,13 @@ Tput.prototype.setup = function() {
|
|||
if (this.debug) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
try {
|
||||
this.injectTerminfo(__dirname + '/../usr/' + this.terminal);
|
||||
return;
|
||||
} catch (e) {}
|
||||
}
|
||||
this._useXtermI();
|
||||
}
|
||||
};
|
||||
|
@ -112,7 +119,7 @@ Tput.prototype.readTerminfo = function(term) {
|
|||
, file
|
||||
, info;
|
||||
|
||||
file = this._prefix(term);
|
||||
file = path.normalize(this._prefix(term));
|
||||
data = fs.readFileSync(file);
|
||||
info = this.parseTerminfo(data, file);
|
||||
|
||||
|
@ -125,7 +132,7 @@ Tput.prototype.readTerminfo = function(term) {
|
|||
|
||||
Tput._prefix =
|
||||
Tput.prototype._prefix = function(term) {
|
||||
return (term && term[0] === '/' && term)
|
||||
return (term && (~term.indexOf(path.sep)) && term)
|
||||
|| (term && this.terminfoFile)
|
||||
|| this._tprefix(this.terminfoPrefix, term)
|
||||
|| this._tprefix(process.env.TERMINFO, term)
|
||||
|
|
|
@ -277,6 +277,7 @@ function Screen(options) {
|
|||
log: options.log,
|
||||
debug: options.debug,
|
||||
dump: options.dump,
|
||||
term: options.term,
|
||||
tput: true,
|
||||
buffer: true,
|
||||
zero: true
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue