Compare commits

...
Sign in to create a new pull request.

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

View file

@ -534,12 +534,9 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
) )
const connected = useConnected() const connected = useConnected()
const currentWorktreeWorkspace = createMemo(() => { const currentSessionLocation = createMemo(() => {
const workspaceID = project.workspace.current() if (route.data.type !== "session") return
if (!workspaceID) return return sync.session.get(route.data.sessionID)?.directory
const workspace = project.workspace.get(workspaceID)
if (workspace?.type !== "worktree" || !workspace.directory) return
return workspace
}) })
const appCommands = createMemo(() => const appCommands = createMemo(() =>
[ [
@ -578,16 +575,16 @@ function App(props: { onSnapshot?: () => Promise<string[]>; pluginHost: TuiPlugi
}, },
}, },
{ {
name: "workspace.copy_path", name: "session.copy_location",
title: "Copy worktree path", title: "Copy session location",
category: "Workspace", category: "Session",
enabled: () => currentWorktreeWorkspace() !== undefined, enabled: () => currentSessionLocation() !== undefined,
run: async () => { run: async () => {
const workspace = currentWorktreeWorkspace() const directory = currentSessionLocation()
if (!workspace?.directory) return if (!directory) return
await clipboard await clipboard
.write?.(workspace.directory) .write?.(directory)
.then(() => toast.show({ message: "Copied worktree path", variant: "info" })) .then(() => toast.show({ message: "Copied session location", variant: "info" }))
.catch(toast.error) .catch(toast.error)
dialog.clear() dialog.clear()
}, },