From 18494547bc8df945bc4aa4fc52cfc949214ffe95 Mon Sep 17 00:00:00 2001 From: SuperComboGamer Date: Sat, 13 Dec 2025 01:05:12 -0500 Subject: [PATCH] fix: address code review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Display actual shell name instead of hardcoded "bash" - Fix type assertion by making findFirstTerminal accept null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../src/components/views/terminal-view/terminal-panel.tsx | 8 +++++++- apps/app/src/store/app-store.ts | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/app/src/components/views/terminal-view/terminal-panel.tsx b/apps/app/src/components/views/terminal-view/terminal-panel.tsx index eb0f8eb8..c0fb1eab 100644 --- a/apps/app/src/components/views/terminal-view/terminal-panel.tsx +++ b/apps/app/src/components/views/terminal-view/terminal-panel.tsx @@ -59,6 +59,7 @@ export function TerminalPanel({ const wsRef = useRef(null); const reconnectTimeoutRef = useRef(null); const [isTerminalReady, setIsTerminalReady] = useState(false); + const [shellName, setShellName] = useState("shell"); // Get effective theme from store const getEffectiveTheme = useAppStore((state) => state.getEffectiveTheme); @@ -223,6 +224,11 @@ export function TerminalPanel({ break; case "connected": console.log(`[Terminal] Session connected: ${msg.shell} in ${msg.cwd}`); + if (msg.shell) { + // Extract shell name from path (e.g., "/bin/bash" -> "bash") + const name = msg.shell.split("/").pop() || msg.shell; + setShellName(name); + } break; case "exit": terminal.write(`\r\n\x1b[33m[Process exited with code ${msg.exitCode}]\x1b[0m\r\n`); @@ -462,7 +468,7 @@ export function TerminalPanel({
- bash + {shellName} {/* Font size indicator - only show when not default */} {fontSize !== DEFAULT_FONT_SIZE && ( diff --git a/apps/app/src/store/app-store.ts b/apps/app/src/store/app-store.ts index 93deb21f..12547c6a 100644 --- a/apps/app/src/store/app-store.ts +++ b/apps/app/src/store/app-store.ts @@ -1605,7 +1605,8 @@ export const useAppStore = create()( if (current.tabs.length === 0) return; // Find which tab contains this session - const findFirstTerminal = (node: TerminalPanelContent): string | null => { + const findFirstTerminal = (node: TerminalPanelContent | null): string | null => { + if (!node) return null; if (node.type === "terminal") return node.sessionId; for (const panel of node.panels) { const found = findFirstTerminal(panel); @@ -1640,7 +1641,7 @@ export const useAppStore = create()( // Determine new active session const newActiveTabId = newTabs.length > 0 ? (current.activeTabId && newTabs.find(t => t.id === current.activeTabId) ? current.activeTabId : newTabs[0].id) : null; const newActiveSessionId = newActiveTabId - ? findFirstTerminal(newTabs.find(t => t.id === newActiveTabId)?.layout || null as unknown as TerminalPanelContent) + ? findFirstTerminal(newTabs.find(t => t.id === newActiveTabId)?.layout || null) : null; set({