removed resize logic
This commit is contained in:
parent
7c9e9ea3ac
commit
f3cf457dc9
@ -38,7 +38,7 @@ export const terminalModalStyle = {
|
|||||||
transform: 'translate(-50%, -50%)',
|
transform: 'translate(-50%, -50%)',
|
||||||
width: '70%',
|
width: '70%',
|
||||||
bgcolor: 'background.paper',
|
bgcolor: 'background.paper',
|
||||||
p: 4,
|
p: 1,
|
||||||
borderRadius: 3,
|
borderRadius: 3,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
}
|
}
|
||||||
|
@ -46,16 +46,8 @@ function TerminalComponent (p: {websocket: string|null}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const socket = new WebSocket(websocket);
|
const socket = new WebSocket(websocket);
|
||||||
|
|
||||||
|
|
||||||
terminal.current.onResize(
|
|
||||||
({cols, rows}, _)=>{
|
|
||||||
socket.send(JSON.stringify({CommandType: 'resize', Arguments: [cols, rows]}))
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
socket.addEventListener('open', () => {
|
socket.addEventListener('open', () => {
|
||||||
socket.send(JSON.stringify({CommandType: 'resize', Arguments: [terminal.current?.cols, terminal.current?.rows]}))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.addEventListener('message', (event) => {
|
socket.addEventListener('message', (event) => {
|
||||||
@ -67,6 +59,7 @@ function TerminalComponent (p: {websocket: string|null}) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
console.log("closed websocket")
|
||||||
terminal.current?.dispose();
|
terminal.current?.dispose();
|
||||||
socket.close();
|
socket.close();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user