Skip to content

attach remote opencode server with --dir is broken #11896

Closed

Description

@LiloD

Description

Current tui attach handles --dir with following code

const directory = (() => {
  if (!args.dir) return undefined
  try {
    process.chdir(args.dir)
    return process.cwd()
  } catch {
    // If the directory doesn't exist locally (remote attach), pass it through.
    return args.dir
  }
})()

if process (local) happens to chdir successfully, it will use local process cwd(after chdir) and send wrong dir to server

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    bugSomething isn't working
    on Feb 3, 2026
  2. github-actions commented on Feb 3, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions