Merge branch 'dev' of ssh://git.commumedia.org:2222/alex/headquarter into dev
This commit is contained in:
@@ -167,10 +167,24 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
// Connect WebSocket
|
// Connect WebSocket
|
||||||
const ws = connectWebSocket();
|
const ws = connectWebSocket();
|
||||||
|
|
||||||
// Fit after layout settles - use rAF to ensure DOM is ready
|
// Fit after layout settles - use rAF + timeout to ensure DOM is ready
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
fitAddon.fit();
|
fitAddon.fit();
|
||||||
|
// Force a second fit after layout fully settles
|
||||||
|
setTimeout(() => {
|
||||||
|
fitAddon.fit();
|
||||||
|
const { cols, rows } = term;
|
||||||
|
if (ws.readyState === WebSocket.OPEN) {
|
||||||
|
ws.send(
|
||||||
|
JSON.stringify({
|
||||||
|
type: "resize",
|
||||||
|
cols,
|
||||||
|
rows,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -213,9 +227,6 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
window.addEventListener("resize", handleResize);
|
||||||
|
|
||||||
// Initial resize
|
|
||||||
setTimeout(handleResize, 100);
|
|
||||||
|
|
||||||
// Notify parent about terminal readiness
|
// Notify parent about terminal readiness
|
||||||
if (onTerminalReadyRef.current) {
|
if (onTerminalReadyRef.current) {
|
||||||
const sendData = (data: string) => {
|
const sendData = (data: string) => {
|
||||||
|
|||||||
@@ -2592,24 +2592,19 @@ a.nav-item,
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
padding: var(--space-2);
|
padding: var(--space-2);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal-container .xterm {
|
.terminal-container .xterm {
|
||||||
height: 100%;
|
flex: 1;
|
||||||
width: 100%;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal-container .xterm-viewport {
|
.terminal-container .xterm-viewport {
|
||||||
height: 100% !important;
|
|
||||||
width: 100% !important;
|
|
||||||
background: #1e1e1e !important;
|
background: #1e1e1e !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.terminal-container .xterm-screen {
|
|
||||||
height: 100% !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.terminal-container canvas {
|
.terminal-container canvas {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user