Use pty.onData and pty.onExit instead of deprecated .on() methods

This commit is contained in:
Lukas Geiger 2019-10-22 21:10:51 +01:00 committed by Benjamin Staneck
parent eaab187a0c
commit e7124efa61

View file

@ -131,7 +131,7 @@ module.exports = class Session extends EventEmitter {
} }
this.batcher = new DataBatcher(uid); this.batcher = new DataBatcher(uid);
this.pty.on('data', chunk => { this.pty.onData(chunk => {
if (this.ended) { if (this.ended) {
return; return;
} }
@ -142,7 +142,7 @@ module.exports = class Session extends EventEmitter {
this.emit('data', data); this.emit('data', data);
}); });
this.pty.on('exit', () => { this.pty.onExit(() => {
if (!this.ended) { if (!this.ended) {
this.ended = true; this.ended = true;
this.emit('exit'); this.emit('exit');