From cba5ba03e31d4cb9155173702aea931f9e8af67b Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 30 Jul 2026 13:12:01 -0400 Subject: [PATCH] fix(tui): show shells from session location (#39691) --- packages/tui/src/context/data.tsx | 5 +++++ packages/tui/src/routes/session/composer/shell-tab.tsx | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/tui/src/context/data.tsx b/packages/tui/src/context/data.tsx index 384fd3499c9..af023c2c9f4 100644 --- a/packages/tui/src/context/data.tsx +++ b/packages/tui/src/context/data.tsx @@ -1089,6 +1089,11 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({ list(location?: LocationRef) { return Object.values(store.location[locationKey(location ?? defaultLocation())]?.shell ?? {}) }, + listBySession(sessionID: string) { + return Object.values(store.location) + .flatMap((data) => Object.values(data.shell ?? {})) + .filter((shell) => shell.metadata.sessionID === sessionID) + }, get(id: string) { return Object.values(store.location) .map((data) => data.shell?.[id]) diff --git a/packages/tui/src/routes/session/composer/shell-tab.tsx b/packages/tui/src/routes/session/composer/shell-tab.tsx index 6759852bf72..3eed9deae53 100644 --- a/packages/tui/src/routes/session/composer/shell-tab.tsx +++ b/packages/tui/src/routes/session/composer/shell-tab.tsx @@ -16,9 +16,7 @@ export function ShellTab(props: { sessionID: string }) { const composer = useComposerTab() const shortcuts = Keymap.useShortcuts() - const entries = createMemo(() => - data.shell.list().filter((shell) => shell.metadata.sessionID === props.sessionID && shell.status === "running"), - ) + const entries = createMemo(() => data.shell.listBySession(props.sessionID).filter((shell) => shell.status === "running")) const [store, setStore] = createStore({ selected: 0 }) let scroll: ScrollBoxRenderable | undefined