Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Simplify terminal toggle to only update visibility state

Julius Marminge521238cf8e1d
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index 5423ac60a..5def8849f 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({