How to use the program function from blessed

Find comprehensive JavaScript blessed.program code examples handpicked from public code repositorys.

23
24
25
26
27
28
29
30
31
32

The main functionality is exposed in the main `blessed` module:

``` js
var blessed = require('blessed')
  , program = blessed.program();

program.key('q', function(ch, key) {
  program.clear();
  program.disableMouse();
fork icon549
star icon43
watch icon6

+ 5 other calls in file

1
2
3
4
5
6
7
8
9
10

const io = require('socket.io-client');
const colors = require('./lib/solarized');
const blessed = require('blessed');

let program = blessed.program();
let screen = require('./ui/screen');
let box = require('./ui/box.js');
let input = require('./ui/input');
let list = require('./ui/userlist');
fork icon20
star icon255
watch icon6

3
4
5
6
7
8
9
10
11
12

function renderScreen(screen, stream, screenName, user) {
    screen = new blessed.screen({
        autoPadding: true,
        smartCSR: true,
        program: new blessed.program({
            input: stream,
            output: stream
        }),
        dockBorders: true,
fork icon5
star icon11
watch icon18

+ 5 other calls in file

7
8
9
10
11
12
13
14
15
16
function Screen(host, theme) {
  if (!(this instanceof Screen)) return new Screen(host, theme)
  var self = this
  var opts = {}
  if (process.env.DEBUG) opts.log = './datop.log'
  var program = blessed.program(opts)
  
  process.on('SIGINT', function() {
    self.kill()
  })
fork icon4
star icon31
watch icon4

7
8
9
10
11
12
13
14
15
16
const options = require('minimist')(process.argv.slice(2));
const scheme = options.theme || 'Dracula';
const colors = require(`blessed-themes/themes/${scheme}`);
const theme = require('./src/styles')(colors.colors);

const program = blessed.program();
program.bg(theme.program.bg);
program.fg(theme.program.fg);

const header = blessed.box({
fork icon1
star icon4
watch icon2

+ 9 other calls in file

5
6
7
8
9
10
11
12
13
14
15
  , screen = blessed.screen({
    dump: __dirname +"/layout.log",
    warnings: true,
    debug: true
  })
  , program = blessed.program()
;


program.on("quit", function() {
  process.exit(0);
fork icon0
star icon0
watch icon1

+ 10 other calls in file

28
29
30
31
32
33
34
35
36
37
38
39
exports.getTestContainer = function (sandbox, stubEvents) {
  assert(sandbox, "getTestContainer requires sandbox");


  const MockProgram = function MockProgram() {
    Object.assign(this, {
      key: blessed.program.prototype.key
    });


    EventEmitter.call(this);
  };
fork icon0
star icon0
watch icon0

+ 5 other calls in file