mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 21:50:19 +00:00
fix(tui): show shells from session location (#39691)
This commit is contained in:
parent
49081a4e24
commit
cba5ba03e3
2 changed files with 6 additions and 3 deletions
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue