Skip to content

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

Open

Description

@kirin-xiao

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

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed request, @kirin-xiao! To restate it: you'd like the file name in the TUI's Edit / Write / ApplyPatch tool blocks to be clickable. Clicking it would open the file in $VISUAL/$EDITOR (or the OS default app), with a toast if that fails and Shell's expand/collapse left as it is.

    This can't be built as a plugin right now, because TUI plugins can't hook into how tool blocks are drawn in the transcript. Maintainers will consider it.

    Related issues:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions