Skip to content

Commit

Permalink
terminal: add mouse support of GUI terminal application , such as vim…
Browse files Browse the repository at this point in the history
…, mc (#9805)

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

Signed-off-by: 翰宇 林<[email protected]>
Co-authored-by: stalin <[email protected]>
  • Loading branch information
linhanyu and stalin authored Sep 29, 2021
1 parent 47031c9 commit dfde6ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/terminal/src/browser/terminal-widget-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit dfde6ec

Please sign in to comment.