How to use the node-pty.total function in node-pty

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

github pylonide / pylon / plugins-server / pylon.ide.terminal / tty.js View on Github external
Session.prototype.handleCreate = function(cols, rows) {
  var self = this
    , terms = this.terms
    , conf = this.server.conf;

  var len = Object.keys(terms).length
    , term
    , id;

  if (len >= conf.limitPerUser || pty.total >= conf.limitGlobal) {
    this.warning('Terminal limit reached.');
    self.socket.send(JSON.stringify({cmd: 'createACK', error: 'Terminal limit.' }));
  }

  var shell = typeof conf.shell === 'function'
    ? conf.shell(this)
    : conf.shell;

  var shellArgs = typeof conf.shellArgs === 'function'
    ? conf.shellArgs(this)
    : conf.shellArgs;

  term = pty.spawn(shell, shellArgs, {
    name: conf.termName,
    cols: cols,
    rows: rows,

node-pty

Fork pseudoterminals in Node.JS

MIT
Latest version published 1 year ago

Package Health Score

75 / 100
Full package analysis

Similar packages