removed resize logic

This commit is contained in:
ACoolName 2024-05-27 21:47:26 +03:00
parent 7c9e9ea3ac
commit f3cf457dc9
2 changed files with 2 additions and 9 deletions

View File

@ -38,7 +38,7 @@ export const terminalModalStyle = {
transform: 'translate(-50%, -50%)',
width: '70%',
bgcolor: 'background.paper',
p: 4,
p: 1,
borderRadius: 3,
padding: 10,
}

View File

@ -46,16 +46,8 @@ function TerminalComponent (p: {websocket: string|null}) {
}
const socket = new WebSocket(websocket);
terminal.current.onResize(
({cols, rows}, _)=>{
socket.send(JSON.stringify({CommandType: 'resize', Arguments: [cols, rows]}))
}
)
socket.addEventListener('open', () => {
socket.send(JSON.stringify({CommandType: 'resize', Arguments: [terminal.current?.cols, terminal.current?.rows]}))
});
socket.addEventListener('message', (event) => {
@ -67,6 +59,7 @@ function TerminalComponent (p: {websocket: string|null}) {
});
return () => {
console.log("closed websocket")
terminal.current?.dispose();
socket.close();
};