fix(attach): allow remote --dir (#8969)
This commit is contained in:
@@ -21,11 +21,19 @@ export const AttachCommand = cmd({
|
||||
describe: "session id to continue",
|
||||
}),
|
||||
handler: async (args) => {
|
||||
if (args.dir) process.chdir(args.dir)
|
||||
let directory = args.dir
|
||||
if (args.dir) {
|
||||
try {
|
||||
process.chdir(args.dir)
|
||||
directory = process.cwd()
|
||||
} catch {
|
||||
// If the directory doesn't exist locally (remote attach), pass it through.
|
||||
}
|
||||
}
|
||||
await tui({
|
||||
url: args.url,
|
||||
args: { sessionID: args.session },
|
||||
directory: args.dir ? process.cwd() : undefined,
|
||||
directory,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user