Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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()
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',
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);
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}`)
});
})
}
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);
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);
const createScreen = () => {
var screen = blessed.screen({
autoPadding: true,
fullUnicode: true,
fastCSR: true,
title: "steam-chat"
});
return screen;
}
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();
}