resize when socket is open

This commit is contained in:
ACoolName 2024-05-27 20:51:29 +03:00
parent 2dcf21d62e
commit 7c9e9ea3ac

View File

@ -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) => {