opencode icon indicating copy to clipboard operation
opencode copied to clipboard

/editor opens a random temp file instead of current workspace file on macOS

Open m0n99 opened this issue 1 month ago • 4 comments

Description

Running /editor opens an unrelated Markdown file from macOS temporary directories (e.g. /var/folders/.../T/*.md) instead of a file from the current workspace. Each execution may open a different temp file.

I also tried setting $EDITOR to both vim and code --wait, but the behavior is the same.

OpenCode version

1.0.185

Steps to reproduce

  1. Launch opencode in a project workspace on macOS
  2. Run the /editor command.
  3. Observe that a random file from /var/folders/.../T/ is opened instead of a workspace file.
  4. Repeat /editor → a different temp file may open.

Screenshot and/or share link

Image Image

Operating System

macOS 15.6.1

Terminal

Ghostty

m0n99 avatar Dec 23 '25 08:12 m0n99

There are other editor-related issues in the repository that may have context relevant to this problem:

  • #4834: Crash After Exiting Editor (editor crashes after exiting)
  • #3359: opentui: open editor not working well (editor input issues)

While these aren't direct duplicates, they may share similar root causes. Feel free to cross-reference if needed.

github-actions[bot] avatar Dec 23 '25 08:12 github-actions[bot]

/oc update tui so that /editor makes a file in cwd like /export does.

Also make sure that the file is cleaned up

rekram1-node avatar Dec 23 '25 20:12 rekram1-node

Created PR #6059

New%20session%20-%202025-12-23T20%3A13%3A35.026Z opencode session  |  github run

opencode-agent[bot] avatar Dec 23 '25 20:12 opencode-agent[bot]

Btw this is intentional behavior

rekram1-node avatar Dec 23 '25 20:12 rekram1-node

i have the same issue, any help?

WhateverMO avatar Feb 07 '26 12:02 WhateverMO