Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/opencode/src/cli/cmd/tui/context/directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { Global } from "@/global"
export function useDirectory() {
const sync = useSync()
return createMemo(() => {
const result = process.cwd().replace(Global.Path.home, "~")
const directory = sync.data.path.directory ?? process.cwd()
const result = directory.replace(Global.Path.home, "~")
if (sync.data.vcs?.branch) return result + ":" + sync.data.vcs.branch
return result
})
Expand Down
4 changes: 4 additions & 0 deletions packages/opencode/src/cli/cmd/tui/context/sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type { Snapshot } from "@/snapshot"
import { useExit } from "./exit"
import { batch, onMount } from "solid-js"
import { Log } from "@/util/log"
import type { Path } from "@opencode-ai/sdk"

export const { use: useSync, provider: SyncProvider } = createSimpleContext({
name: "Sync",
Expand Down Expand Up @@ -62,6 +63,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
}
formatter: FormatterStatus[]
vcs: VcsInfo | undefined
path: Path
}>({
provider_next: {
all: [],
Expand All @@ -86,6 +88,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
mcp: {},
formatter: [],
vcs: undefined,
path: { state: "", config: "", worktree: "", directory: "" },
})

const sdk = useSDK()
Expand Down Expand Up @@ -286,6 +289,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
sdk.client.session.status().then((x) => setStore("session_status", x.data!)),
sdk.client.provider.auth().then((x) => setStore("provider_auth", x.data ?? {})),
sdk.client.vcs.get().then((x) => setStore("vcs", x.data)),
sdk.client.path.get().then((x) => setStore("path", x.data!)),
]).then(() => {
setStore("status", "complete")
})
Expand Down