html: handle binary xterm event

This commit is contained in:
Shuanglei Tao
2022-10-30 13:39:00 +08:00
parent f7baae7856
commit 11ec9798ee
2 changed files with 931 additions and 922 deletions

View File

@@ -210,6 +210,7 @@ export class Xterm extends Component<Props, State> {
}
});
terminal.onData(this.onTerminalData);
terminal.onBinary(this.onTerminalBinary);
terminal.onResize(this.onTerminalResize);
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
terminal.onSelectionChange(() => {
@@ -484,4 +485,9 @@ export class Xterm extends Component<Props, State> {
private onTerminalData(data: string) {
this.sendData(data);
}
@bind
private onTerminalBinary(data: string) {
this.sendData(Uint8Array.from(data, v => v.charCodeAt(0)));
}
}

1847
src/html.h generated

File diff suppressed because it is too large Load Diff