The best way to control Claude Code, Codex and more from any computer or phone
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
Julius Marminge committed
Feb 12, 2026 at 22:39 UTC
521238cf8e1daf041e7541bb1acef8c347431079
1 file changed
+2
-14
apps/web/src/components/ChatView.tsx
+2
-14
@@ -262,24 +262,12 @@ export default function ChatView() {
262
}, []);
263
const toggleTerminalVisibility = useCallback(() => {
264
if (!activeThreadId) return;
265
- const isOpen = Boolean(activeThread?.terminalOpen);
266
-
267
- if (isOpen && api) {
268
- if (typeof api.terminal.close === "function") {
269
- void api.terminal.close({ threadId: activeThreadId }).catch(() => {
270
- void api.terminal.write({ threadId: activeThreadId, data: "exit\n" }).catch(() => undefined);
271
- });
272
- } else {
273
- void api.terminal.write({ threadId: activeThreadId, data: "exit\n" }).catch(() => undefined);
274
- }
275
- }
276
-
265
dispatch({
266
type: "SET_THREAD_TERMINAL_OPEN",
267
threadId: activeThreadId,
280
- open: !isOpen,
268
+ open: !activeThread?.terminalOpen,
269
});
282
- }, [activeThread?.terminalOpen, activeThreadId, api, dispatch]);
270
+ }, [activeThread?.terminalOpen, activeThreadId, dispatch]);
271
const splitTerminal = useCallback(() => {
272
if (!activeThreadId) return;
273
dispatch({