fix: send resize message when font size changes

- After changing font size and calling fit(), send resize message to WebSocket
- OpenCode now receives correct terminal dimensions after font size adjustment
- Fixes issue where OpenCode UI didn't fill available space after font resize
This commit is contained in:
Fusion
2026-05-24 13:57:22 +02:00
parent e265c86997
commit 030a39dd5a
+10
View File
@@ -290,6 +290,16 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
if (termRef.current && fitAddonRef.current) {
try {
fitAddonRef.current.fit();
const { cols, rows } = termRef.current;
if (wsRef.current?.readyState === WebSocket.OPEN) {
wsRef.current.send(
JSON.stringify({
type: "resize",
cols,
rows,
})
);
}
} catch {
// Ignore fit errors during re-initialization
}