How to use the blessed.screen function in blessed

To help you get started, we’ve selected a few blessed examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apparatus / terminal-devtools / src / screen.js View on Github external
export default store => {
  const screen = blessed.screen({
    autoPadding: true,
    smartCSR: true,
    title: 'Terminal Devtools',
    sendFocus: true,
    dockBorders: true,
    log: './log',
    // log: '/dev/ttys001',
    terminal: 'xterm-256color',
    ignoreLocked: ['C-c']
  })

  console.log = screen.log.bind(screen)
  console.error = screen.log.bind(screen, 'ERROR: ')

  keys(store, screen)
github rse / stmux / src / stmux-3-screen.js View on Github external
try { winpty = which.sync("winpty") }
            catch (ex) {
                this.fatal("under Windows/MinTTY you need the \"winpty\" utility on PATH")
            }
            const child = childProcess.spawnSync(winpty, process.argv, {
                stdio: [ "inherit", "inherit", "inherit" ]
            })
            process.exit(child.status)
        }

        /*  final sanity check for TTY  */
        if (!process.stdin.isTTY || !process.stdout.isTTY)
            this.fatal("we are not attached to a TTY device")

        /*  establish Blessed screen  */
        this.screen = Blessed.screen({
            title:       this.argv.title,
            smartCSR:    true,
            autoPadding: false,
            warnings:    false
        })

        /*  disable cursor  */
        this.screen.program.hideCursor()

        /*  optionally enable mouse event handling  */
        if (this.argv.mouse)
            this.screen.enableMouse()

        /*  determine screen size  */
        this.calcScreenSize()
github bulkan / pggy / index.js View on Github external
Knex.knex = Knex.initialize({
  client: 'pg',
  connection: {
    host     : conf.hostname,
    user     : conf.username,
    password : conf.password,
    database : conf.database,
  }
});

utils = require('./lib/utils')(Knex.knex, log);


// Create a screen object.
var screen = blessed.screen();

var searchBox = blessed.textbox({
  width: '30%',
  height: '7%',
  top: 'center',
  left: '30%',
  border: {
    type: 'line',
    fg: 'blue'
  },
  label: 'table search',
  padding: {
    left: 1,
  },
  inputOnFocus: true,
  right: '0',
github DefinitelyTyped / DefinitelyTyped / types / react-blessed / react-blessed-tests.tsx View on Github external
class={stylesheet.bordered}
        top='70%'
        left='60%'
        width='40%'
        height='31%'
      >
        Some stats
      
    );
  }
}

/**
 * Rendering the screen.
 */
const screen = blessed.screen({
  autoPadding: true,
  smartCSR: true,
  title: 'react-blessed dashboard'
});

screen.key(['escape', 'q', 'C-c'], () => {
  return process.exit(0);
});

render(, screen);
github goldbergyoni / nodejs-course / examples / basics / hello-random-students / final.js View on Github external
var fs = require('fs');
var terminal = require('terminal-kit').terminal;
var blessed = require('blessed'),
    contrib = require('blessed-contrib'),
    screen = blessed.screen();

class studentService {
    getWinner() {
        const allStudents = fs.readFile('./students.txt', 'utf-8', function (error, data) {
            const studentsArray = data.split(';');
            var pic = contrib.picture(
                { file: './goodmorning.png'
                , cols: 25
                , onReady: (ready)})
             function ready() {screen.render()}
    
            studentsArray.forEach(student => {
                console.log(`Good morning ${student}`)
            });
        })
    }
github ewnd9 / badtaste / playground / react.js View on Github external
const Logger = console;

const App = React.createClass({
  setMessageRef(msg) {
    msg.focus();
  },
  render() {
    return (
      <element>
        
      </element>
    );
  }
});

const screen = blessed.screen({
  smartCSR: true,
  title: 'react-blessed hello world'
});

screen.key(['escape', 'q', 'C-c'], function(ch, key) {
  return process.exit(0);
});

const component = render(, screen);
github alkhe / cycle-blessed / example / writer.js View on Github external
import { run } from '@cycle/core';
import blessed from 'blessed';
import { makeTermDriver, box } from '../src';
import { view, key } from '../src/transform';

let screen = blessed.screen({ smartCSR: true, useBCE: true, title: 'Writer' });

let HelloBox = text => box({
	top: 'center', left: 'center',
	width: 'shrink', height: 'shrink',
	tags: true,
	content: `{bold}${ text }{/bold}`,
	border: {
		type: 'line',
		fg: 'blue'
	}
});

run(({ term: { on } }) => {	
	let text$ = on('*keypress', view(1))
		.startWith('').scan((str, char) => str + char);
github uosl / steam-chat / lib / ui / ui.js View on Github external
const createScreen = () => {
    var screen = blessed.screen({
        autoPadding: true,
        fullUnicode: true,
        fastCSR: true,
        title: "steam-chat"
    });

    return screen;
}
github rafaelrinaldi / hn-cli / src / renderer.js View on Github external
render(data) {
    this.screen = UI.screen(screenOptions);
    this.table = UI.listtable(tableOptions);

    this.statusBarLeft = UI.box(statusBarOptions.left);
    this.statusBarRight = UI.box(statusBarOptions.right);

    this.table.focus();
    this.table.setData(data);

    this.screen.append(this.table);
    this.screen.append(this.statusBarLeft);
    this.screen.append(this.statusBarRight);
    this.screen.render();

    this.setupEvents();
    this.reportProgress();
  }