From cab79b50bee4a0e86e9a371057b3ac5a81486468 Mon Sep 17 00:00:00 2001 From: Saatvik Arya Date: Mon, 5 Jan 2026 17:07:56 +0530 Subject: [PATCH] fix(tui): update directory handling in AttachCommand to conditionally set current working directory --- packages/opencode/src/cli/cmd/tui/attach.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/attach.ts b/packages/opencode/src/cli/cmd/tui/attach.ts index 561a8ced68d..3f9285f631c 100644 --- a/packages/opencode/src/cli/cmd/tui/attach.ts +++ b/packages/opencode/src/cli/cmd/tui/attach.ts @@ -22,11 +22,10 @@ export const AttachCommand = cmd({ }), handler: async (args) => { if (args.dir) process.chdir(args.dir) - const directory = process.cwd() await tui({ url: args.url, args: { sessionID: args.session }, - directory, + directory: args.dir ? process.cwd() : undefined, }) }, })