diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 57b03f10..dd96d393 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,10 @@
-
+
-
@@ -117,7 +116,7 @@
1733439468142
-
+
@@ -207,7 +206,15 @@
1733539381433
-
+
+
+ 1733553128900
+
+
+
+ 1733553128900
+
+
@@ -244,6 +251,7 @@
-
+
+
\ No newline at end of file
diff --git a/backend/server.js b/backend/server.js
index 7e1bed3f..e3f89b27 100644
--- a/backend/server.js
+++ b/backend/server.js
@@ -49,10 +49,6 @@ wss.on('connection', (ws) => {
return;
}
- // Set the terminal size dynamically based on the WebSocket message
- const sttyCommand = `stty -echo rows ${data.rows} cols ${data.cols}\n`;
- stream.write(sttyCommand);
-
// Handle data from SSH session
stream.on('data', (data) => {
console.log(`SSH Output: ${data}`);
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index c1d09f31..7528fecf 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -38,6 +38,12 @@ const App = () => {
// Resize terminal to fit the container initially
fitAddon.current.fit();
+ terminal.current.onData((data) => {
+ if (socket.current && socket.current.readyState === WebSocket.OPEN) {
+ socket.current.send(data);
+ }
+ });
+
// Adjust terminal size on window resize
const handleResize = () => {
fitAddon.current.fit();
@@ -49,8 +55,8 @@ const App = () => {
}));
}
};
-
window.addEventListener('resize', handleResize);
+
return () => {
terminal.current.dispose();
if (socket.current) socket.current.close();