diff --git a/src/terminal.tsx b/src/terminal.tsx index 5b1bc53..6300bf7 100644 --- a/src/terminal.tsx +++ b/src/terminal.tsx @@ -47,7 +47,6 @@ function TerminalComponent (p: {websocket: string|null}) { const socket = new WebSocket(websocket); - socket.send(JSON.stringify({CommandType: 'resize', Arguments: [terminal.current.cols, terminal.current.rows]})) terminal.current.onResize( ({cols, rows}, _)=>{ @@ -56,6 +55,7 @@ function TerminalComponent (p: {websocket: string|null}) { ) socket.addEventListener('open', () => { + socket.send(JSON.stringify({CommandType: 'resize', Arguments: [terminal.current?.cols, terminal.current?.rows]})) }); socket.addEventListener('message', (event) => {