From 030a39dd5af56e84705c01f08fd038064508690c Mon Sep 17 00:00:00 2001 From: Fusion Date: Sun, 24 May 2026 13:57:22 +0200 Subject: [PATCH] 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 --- apps/web/src/components/terminal.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/web/src/components/terminal.tsx b/apps/web/src/components/terminal.tsx index a6eddf1..f050f76 100644 --- a/apps/web/src/components/terminal.tsx +++ b/apps/web/src/components/terminal.tsx @@ -290,6 +290,16 @@ export const TerminalComponent: React.FC = ({ 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 }