From 521238cf8e1daf041e7541bb1acef8c347431079 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Feb 2026 22:39:16 -0800 Subject: [PATCH] Simplify terminal toggle to only update visibility state - Remove terminal close/exit API calls from `toggleTerminalVisibility` - Keep toggle behavior as a pure UI state change for active thread --- apps/web/src/components/ChatView.tsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 5423ac60a6971ce8c79f694038b4f5fbad53053c..5def8849f8dc0ab5a25c92aba6f3c55242641fb2 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -262,24 +262,12 @@ export default function ChatView() { }, []); const toggleTerminalVisibility = useCallback(() => { if (!activeThreadId) return; - const isOpen = Boolean(activeThread?.terminalOpen); - - if (isOpen && api) { - if (typeof api.terminal.close === "function") { - void api.terminal.close({ threadId: activeThreadId }).catch(() => { - void api.terminal.write({ threadId: activeThreadId, data: "exit\n" }).catch(() => undefined); - }); - } else { - void api.terminal.write({ threadId: activeThreadId, data: "exit\n" }).catch(() => undefined); - } - } - dispatch({ type: "SET_THREAD_TERMINAL_OPEN", threadId: activeThreadId, - open: !isOpen, + open: !activeThread?.terminalOpen, }); - }, [activeThread?.terminalOpen, activeThreadId, api, dispatch]); + }, [activeThread?.terminalOpen, activeThreadId, dispatch]); const splitTerminal = useCallback(() => { if (!activeThreadId) return; dispatch({ -- 2.54.0