anomalyco / anomalyco/opencode

[FEATURE]: TUI: click the file name on Edit/Write/ApplyPatch blocks to open it in the editor

Open
#48,609 0 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Sep 12, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

When the agent edits a file, the TUI renders ← Edit <file> with the patch below it. Today that title is plain text. I'd like the file name to be clickable so it opens in my editor, with the diff/patch available there — so I can jump straight from the transcript to the changed code without copy-pasting paths.

Current behavior

The Edit/Write/ApplyPatch titles are rendered by BlockTool in packages/tui/src/routes/session/index.tsx with no click handler:

  • Edit: :2409← Edit <path>
  • Write: :2115# Wrote <path>
  • ApplyPatch: :2484← Patched <relativePath> / # Created / # Moved / # Deleted

BlockTool already supports onClick, hover highlight, and onMouseUp (:1994-2044); only the Shell tool uses onClick today (:2081). openEditor in packages/tui/src/editor.ts:26 only opens a temporary markdown transcript (used by /export), not an arbitrary workspace file.

Proposed behavior
  • Clicking the file name (ideally just the file name, not the whole block) opens that file in $VISUAL/$EDITOR, falling back to the OS default application.
  • Keep existing block click behavior intact (e.g. Shell expand/collapse).
  • Delete files stay non-clickable; Moved opens the destination path.
  • If no editor is available or opening fails, show a toast instead of doing nothing silently.
Implementation sketch
  • Add an openFile(path, opts) helper in packages/tui/src/editor.ts that spawns the editor directly on the real workspace file, mirroring the existing openEditor suspend/restore lifecycle, with a platform-default fallback.
  • Add an optional onTitleClick / render-prop to BlockTool and wire it in Edit, Write, and ApplyPatch.
  • Update packages/tui/test/util/tool-display.test.ts / renderer.test.ts and add editor tests for VISUAL precedence and path resolution.
Related
  • Prior PR #30404 "feat(tui): make file tool titles clickable" — same scope, auto-closed by the stale-cleanup bot, not rejected on technical grounds.
  • #19005 — Make local file paths clickable in terminal output.
  • #37891 — Desktop: make file paths in chat clickable (open in editor / reveal in Finder).
  • #45001, #44442 — TUI hyperlink / OSC 8 handling.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.