From 01f1ed55e3e5143be99bb34147bf639a95e8cff3 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Thu, 27 Apr 2023 10:30:36 +0800 Subject: [PATCH] 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. --- html/src/components/terminal/xterm/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/src/components/terminal/xterm/index.ts b/html/src/components/terminal/xterm/index.ts index e6809e4..ac49b9f 100644 --- a/html/src/components/terminal/xterm/index.ts +++ b/html/src/components/terminal/xterm/index.ts @@ -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); -- 2.43.4