diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 386b92e8..57b03f10 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,10 @@
-
-
+
+
+
@@ -116,6 +117,7 @@
1733439468142
+
@@ -197,7 +199,15 @@
1733538097802
-
+
+
+ 1733539381433
+
+
+
+ 1733539381433
+
+
@@ -233,6 +243,7 @@
-
+
+
\ No newline at end of file
diff --git a/backend/server.js b/backend/server.js
index f14cd05f..7e1bed3f 100644
--- a/backend/server.js
+++ b/backend/server.js
@@ -50,8 +50,8 @@ wss.on('connection', (ws) => {
}
// Set the terminal size dynamically based on the WebSocket message
- const sttyCommand = `export TERM=xterm && stty rows ${data.rows} cols ${data.cols}`;
- stream.write(sttyCommand + '\n'); // Send the stty command to set terminal size
+ const sttyCommand = `stty -echo rows ${data.rows} cols ${data.cols}\n`;
+ stream.write(sttyCommand);
// Handle data from SSH session
stream.on('data', (data) => {
@@ -66,9 +66,14 @@ wss.on('connection', (ws) => {
});
// When the WebSocket client sends a message (from terminal input), forward it to the SSH stream
- ws.on('message', (message) => {
- console.log(`Received message from WebSocket: ${message}`);
- stream.write(message); // Write the message (input) to the SSH shell
+ ws.on('message', (msg) => {
+ const input = JSON.parse(msg);
+ if (input.type === 'resize') {
+ const resizeCommand = `stty rows ${input.rows} cols ${input.cols}\n`;
+ stream.write(resizeCommand);
+ } else {
+ stream.write(input);
+ }
});
});
}).on('error', (err) => {
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 72549908..c1d09f31 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -39,25 +39,22 @@ const App = () => {
fitAddon.current.fit();
// Adjust terminal size on window resize
- const resizeListener = () => {
+ const handleResize = () => {
fitAddon.current.fit();
- };
- window.addEventListener('resize', resizeListener);
-
- // Monitor terminal data (activity)
- terminal.current.onData((data) => {
if (socket.current && socket.current.readyState === WebSocket.OPEN) {
- socket.current.send(data);
+ socket.current.send(JSON.stringify({
+ type: 'resize',
+ rows: terminal.current.rows,
+ cols: terminal.current.cols,
+ }));
}
- });
+ };
- // Cleanup on component unmount
+ window.addEventListener('resize', handleResize);
return () => {
terminal.current.dispose();
- if (socket.current) {
- socket.current.close();
- }
- window.removeEventListener('resize', resizeListener);
+ if (socket.current) socket.current.close();
+ window.removeEventListener('resize', handleResize);
};
}, []);
diff --git a/info.txt b/info.txt
index e6d6c0df..d9ef6dc0 100644
--- a/info.txt
+++ b/info.txt
@@ -1,7 +1,8 @@
Currently:
make the cmds run at start not show up
see if it auto resizes the terminal via cmds after the browser window size has changed or +/- clicked (does not)
-ntfy notifcation after build push (I think I did)
+before release, call this version 1.0 (don't do beta and shit/come uip with naming scheme like 1.1 or just increment by 1 and when to go to next version)
+fix all the giuthub workflow problems
Overall Features:
SSH/RDP(?)/VNC(?)