From 3bebb4efc5ef56c72c5af838b8ccc77ed22484e1 Mon Sep 17 00:00:00 2001 From: kim Date: Sat, 6 Jun 2026 13:24:38 +0900 Subject: [PATCH] Fix local shell: fit before sending shell request to companion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 터미널 패널이 닫힌 상태에서 로컬 셸을 열면 레이아웃 계산 전에 fitAddon.fit()이 실행돼 rows=0/cols=0으로 companion에 전달됨. 300ms 타임아웃 안에서 fit을 재실행하고 최솟값(24x80) 보장. Co-Authored-By: Claude Sonnet 4.6 --- web-ui/code.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web-ui/code.js b/web-ui/code.js index b609b86..1a0d6a5 100644 --- a/web-ui/code.js +++ b/web-ui/code.js @@ -759,7 +759,10 @@ function addLocalShell() { setTimeout(() => { const shell = codeTermShells.find(s => s.id === id); if (companionConnected && companionWs && shell?.term) { - companionWs.send(JSON.stringify({ type: 'shell', rows: shell.term.rows, cols: shell.term.cols })); + if (shell.fitAddon) shell.fitAddon.fit(); + const rows = shell.term.rows > 0 ? shell.term.rows : 24; + const cols = shell.term.cols > 0 ? shell.term.cols : 80; + companionWs.send(JSON.stringify({ type: 'shell', rows, cols })); } }, 300); }