Skip to content

Instantly share code, notes, and snippets.

@chjj
Created February 21, 2014 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chjj/9127877 to your computer and use it in GitHub Desktop.
Save chjj/9127877 to your computer and use it in GitHub Desktop.
var blessed = require('../')
, screen;
screen = blessed.screen({
dump: __dirname + '/logs/focus-bug.log',
smartCSR: true
});
var lorem = require('fs').readFileSync(__dirname + '/git.diff', 'utf8');
blessed.box({
parent: screen,
left: 'center',
top: 'center',
width: '80%',
height: '80%',
bg: 'green',
border: {
type: 'ascii'
},
content: 'CSR should still work.'
});
var text = blessed.scrollabletext({
parent: screen,
content: lorem,
border: {
type: 'ascii'
},
left: 'center',
top: 'center',
width: '100%',
width: '50%',
height: '50%',
mouse: true,
keys: true,
vi: true
});
text.focus();
setTimeout(function() {
text.hide();
screen.render();
}, 4000);
screen.key('q', function() {
return process.exit(0);
});
screen.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment