mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-02 17:04:24 +01:00
fix flow control (#1093)
According to [xterm.js](http://xtermjs.org/docs/guides/flowcontrol/#ideas-for-a-better-mechanism), pause and resume are in wrong places.
This commit is contained in:
@@ -199,13 +199,13 @@ export class Xterm {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user