From: Shuanglei Tao Date: Fri, 21 Jun 2019 23:42:39 +0000 (+0800) Subject: html: attach the term instance to window X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=5dfcb8dd3e57c2b0da98935e420609b49f7d8486;p=ttyd.git html: attach the term instance to window --- diff --git a/html/src/components/terminal/index.tsx b/html/src/components/terminal/index.tsx index 55aedc0..2f159ed 100644 --- a/html/src/components/terminal/index.tsx +++ b/html/src/components/terminal/index.tsx @@ -86,6 +86,7 @@ export default class Xterm extends Component { 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; diff --git a/src/index.html b/src/index.html index 1587364..2d3d9bf 100644 --- a/src/index.html +++ b/src/index.html @@ -1 +1 @@ -ttyd - Terminal \ No newline at end of file +ttyd - Terminal \ No newline at end of file