From e9f17e09d720cdc9c6a640a6241381307474e250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=B0=E5=AE=87=20=E6=9E=97?= <305991071@qq.com> Date: Fri, 30 Jul 2021 20:30:38 +0800 Subject: [PATCH 1/2] terminal: add mouse support of GUI terminal application , such as vim mouse mode and mc Application such as vim use binary message to indicate mouse event but not utf-8 data. In xterm.js, it be emitted by onBinary. Simplely connect it to send Data and resolved. Test environment: MacOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 翰宇 林<305991071@qq.com> --- packages/terminal/src/browser/terminal-widget-impl.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/terminal/src/browser/terminal-widget-impl.ts b/packages/terminal/src/browser/terminal-widget-impl.ts index 89b051be547ba..b7a66b0d0609a 100644 --- a/packages/terminal/src/browser/terminal-widget-impl.ts +++ b/packages/terminal/src/browser/terminal-widget-impl.ts @@ -234,6 +234,10 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget this.onDataEmitter.fire(data); })); + this.toDispose.push(this.term.onBinary(data => { + this.onDataEmitter.fire(data); + })); + for (const contribution of this.terminalContributionProvider.getContributions()) { contribution.onCreate(this); } @@ -499,7 +503,10 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget } }; - const disposable = this.term.onData(sendData); + const disposable = new DisposableCollection; + disposable.push(this.term.onData(sendData)); + disposable.push(this.term.onBinary(sendData)); + connection.onDispose(() => disposable.dispose()); this.toDisposeOnConnect.push(connection); From f85cf084d32c30df1f6e55f8fd9b7c172cc6c295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=B0=E5=AE=87=20=E6=9E=97?= <305991071@qq.com> Date: Fri, 6 Aug 2021 11:03:31 +0800 Subject: [PATCH 2/2] terminal: fix lint probleam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 翰宇 林<305991071@qq.com> --- packages/terminal/src/browser/terminal-widget-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/terminal/src/browser/terminal-widget-impl.ts b/packages/terminal/src/browser/terminal-widget-impl.ts index b7a66b0d0609a..835470e7de950 100644 --- a/packages/terminal/src/browser/terminal-widget-impl.ts +++ b/packages/terminal/src/browser/terminal-widget-impl.ts @@ -503,7 +503,7 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget } }; - const disposable = new DisposableCollection; + const disposable = new DisposableCollection(); disposable.push(this.term.onData(sendData)); disposable.push(this.term.onBinary(sendData));