Преглед изворни кода

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 месеци
родитељ
комит
2d7e9575d2
1 измењених фајлова са 1 додато и 1 уклоњено
  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()
       win32DisableProcessedInput()
 
 
       const directory = (() => {
       const directory = (() => {
-        if (!args.dir) return undefined
+        if (!args.dir) return process.cwd()
         try {
         try {
           process.chdir(args.dir)
           process.chdir(args.dir)
           return process.cwd()
           return process.cwd()