From 2d7e9575d2ad40ce4775aabc4d3cce71b4963a37 Mon Sep 17 00:00:00 2001 From: Ryan Vogel Date: Mon, 16 Feb 2026 08:30:49 -0500 Subject: [PATCH] fix(attach): default working directory to invoker's cwd When running `opencode attach` without `--dir`, the TUI session previously used the server's process.cwd() as its working directory. This changes the default to send the attaching client's cwd so the session operates in the directory where the attach command was invoked. --- packages/opencode/src/cli/cmd/tui/attach.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/tui/attach.ts b/packages/opencode/src/cli/cmd/tui/attach.ts index 8b8979c831c7..6dc59f424651 100644 --- a/packages/opencode/src/cli/cmd/tui/attach.ts +++ b/packages/opencode/src/cli/cmd/tui/attach.ts @@ -32,7 +32,7 @@ export const AttachCommand = cmd({ win32DisableProcessedInput() const directory = (() => { - if (!args.dir) return undefined + if (!args.dir) return process.cwd() try { process.chdir(args.dir) return process.cwd()