mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-13 23:52:06 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user