According to [xterm.js](http://xtermjs.org/docs/guides/flowcontrol/#ideas-for-a-better-mechanism), pause and resume are in wrong places.
terminal.write(data, () => {
this.pending = Math.max(this.pending - 1, 0);
if (this.pending < lowWater) {
- this.socket?.send(textEncoder.encode(Command.PAUSE));
+ this.socket?.send(textEncoder.encode(Command.RESUME));
}
});
this.pending++;
this.written = 0;
if (this.pending > highWater) {
- this.socket?.send(textEncoder.encode(Command.RESUME));
+ this.socket?.send(textEncoder.encode(Command.PAUSE));
}
} else {
terminal.write(data);