html: attach the term instance to window

This commit is contained in:
Shuanglei Tao
2019-06-22 07:42:39 +08:00
parent 11c1e1bc79
commit 5dfcb8dd3e
2 changed files with 2 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ export default class Xterm extends Component<Props> {
this.socket = new WebSocket(this.props.url, ['tty']);
this.terminal = new Terminal(this.props.options);
const { socket, terminal, container, fitAddon, overlayAddon } = this;
(window as any).term = terminal;
socket.binaryType = 'arraybuffer';
socket.onopen = this.onSocketOpen;