Description
The following code fixed it for me:
--- a/packages/opencode/src/cli/cmd/tui/thread.ts
+++ b/packages/opencode/src/cli/cmd/tui/thread.ts
@@ -120,11 +120,14 @@ export const TuiThreadCommand = cmd({
return
}
- // Resolve relative paths against PWD to preserve behavior when using --cwd flag
+ // Use PWD as the base for resolving relative --project paths so that
+ // symlink-aware shells see the right directory. For the no-project case,
+ // use the real OS cwd so that Instance.directory always matches the
+ // canonical path that git and other tools report.
const root = Filesystem.resolve(process.env.PWD ?? process.cwd())
const cwd = args.project
? Filesystem.resolve(path.isAbsolute(args.project) ? args.project : path.join(root, args.project))
- : root
+ : Filesystem.resolve(process.cwd())
const file = await target()
try {
process.chdir(cwd)
Plugins
No response
OpenCode version
1.2.21
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Linux, Ubuntu 24.04
Terminal
Ghostty
Description
dir/proj, wherediris a symlink, leads to opencode v1.2.21 freezing when starting a new session.The following code fixed it for me:
Plugins
No response
OpenCode version
1.2.21
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Linux, Ubuntu 24.04
Terminal
Ghostty