Update terminal-panel.tsx

This commit is contained in:
MacRimi
2025-11-23 17:29:11 +01:00
parent 2b4fb55526
commit 9dd4df2ca9

View File

@@ -367,8 +367,6 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
scrollback: 2000, scrollback: 2000,
disableStdin: false, disableStdin: false,
customGlyphs: true, customGlyphs: true,
cols: isMobile ? 40 : layout === "grid" ? 60 : 120,
rows: isMobile ? 20 : layout === "grid" ? 20 : 40,
theme: { theme: {
background: "#000000", background: "#000000",
foreground: "#ffffff", foreground: "#ffffff",
@@ -450,8 +448,13 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
} }
}) })
let resizeTimeout: any = null
const handleResize = () => { const handleResize = () => {
syncSizeWithBackend() clearTimeout(resizeTimeout)
resizeTimeout = setTimeout(() => {
syncSizeWithBackend()
}, 150)
} }
window.addEventListener("resize", handleResize) window.addEventListener("resize", handleResize)