Sfoglia il codice sorgente

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.
Ryan Vogel 6 mesi fa
parent
commit
2d7e9575d2
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      packages/opencode/src/cli/cmd/tui/attach.ts

+ 1 - 1
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()