anomalyco / anomalyco/opencode
[FEATURE]: TUI: click the file name on Edit/Write/ApplyPatch blocks to open it in the editor
@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).
Deletefiles stay non-clickable;Movedopens 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 inpackages/tui/src/editor.tsthat spawns the editor directly on the real workspace file, mirroring the existingopenEditorsuspend/restore lifecycle, with a platform-default fallback. - Add an optional
onTitleClick/ render-prop toBlockTooland wire it inEdit,Write, andApplyPatch. - Update
packages/tui/test/util/tool-display.test.ts/renderer.test.tsand add editor tests forVISUALprecedence 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.