diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 3cf3e3cd..a38c8c1f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,9 @@
-
-
+
+
-
@@ -113,7 +112,7 @@
1733439468142
-
+
@@ -123,15 +122,23 @@
1733447944692
-
+
+
+ 1733448864234
+
+
+
+ 1733448864234
+
+
-
-
+
+
\ No newline at end of file
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 642f3d15..e6589d84 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -22,15 +22,21 @@ const App = () => {
theme: { background: '#1e1e1e', foreground: '#ffffff' },
macOptionIsMeta: true,
allowProposedApi: true,
- fontSize: 14, // Set the default font size initially
+ fontSize: 14,
});
fitAddon.current = new FitAddon();
terminal.current.loadAddon(fitAddon.current);
+ let resizeObserver = new ResizeObserver(() => {
+ fitAddon.current.fit();
+ notifyServerOfResize();
+ });
+
if (terminalRef.current) {
terminal.current.open(terminalRef.current);
console.log('Terminal opened successfully.');
+ resizeObserver.observe(terminalRef.current);
} else {
console.error('Terminal reference is not valid!');
}
@@ -72,6 +78,7 @@ const App = () => {
socket.current.close();
}
window.removeEventListener('resize', resizeTerminal);
+ resizeObserver.disconnect();
};
}, []);
@@ -159,4 +166,4 @@ const App = () => {
);
};
-export default App;
+export default App;
\ No newline at end of file