in src/terminal.ts [52:75]
constructor(opt?: IPtyForkOptions) {
// for 'close'
this._internalee = new EventEmitter();
if (!opt) {
return;
}
// Do basic type checks here in case node-pty is being used within JavaScript. If the wrong
// types go through to the C++ side it can lead to hard to diagnose exceptions.
this._checkType('name', opt.name ? opt.name : undefined, 'string');
this._checkType('cols', opt.cols ? opt.cols : undefined, 'number');
this._checkType('rows', opt.rows ? opt.rows : undefined, 'number');
this._checkType('cwd', opt.cwd ? opt.cwd : undefined, 'string');
this._checkType('env', opt.env ? opt.env : undefined, 'object');
this._checkType('uid', opt.uid ? opt.uid : undefined, 'number');
this._checkType('gid', opt.gid ? opt.gid : undefined, 'number');
this._checkType('encoding', opt.encoding ? opt.encoding : undefined, 'string');
// setup flow control handling
this.handleFlowControl = !!(opt.handleFlowControl);
this._flowControlPause = opt.flowControlPause || FLOW_CONTROL_PAUSE;
this._flowControlResume = opt.flowControlResume || FLOW_CONTROL_RESUME;
}