Compare commits

...

2 Commits

Author SHA1 Message Date
opencode-agent[bot] 3a5d684c69 fix(tui): copy active session directory 2026-06-10 05:07:35 +00:00
opencode-agent[bot] 8385cc2f44 fix(tui): label worktree copy as session location 2026-06-10 05:03:26 +00:00
+11 -14
View File
@@ -534,12 +534,9 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
)
const connected = useConnected()
const currentWorktreeWorkspace = createMemo(() => {
const workspaceID = project.workspace.current()
if (!workspaceID) return
const workspace = project.workspace.get(workspaceID)
if (workspace?.type !== "worktree" || !workspace.directory) return
return workspace
const currentSessionLocation = createMemo(() => {
if (route.data.type !== "session") return
return sync.session.get(route.data.sessionID)?.directory
})
const appCommands = createMemo(() =>
[
@@ -578,16 +575,16 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
},
},
{
name: "workspace.copy_path",
title: "Copy worktree path",
category: "Workspace",
enabled: () => currentWorktreeWorkspace() !== undefined,
name: "session.copy_location",
title: "Copy session location",
category: "Session",
enabled: () => currentSessionLocation() !== undefined,
run: async () => {
const workspace = currentWorktreeWorkspace()
if (!workspace?.directory) return
const directory = currentSessionLocation()
if (!directory) return
await clipboard
.write?.(workspace.directory)
.then(() => toast.show({ message: "Copied worktree path", variant: "info" }))
.write?.(directory)
.then(() => toast.show({ message: "Copied session location", variant: "info" }))
.catch(toast.error)
dialog.clear()
},