Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,