Skip to content

How should opening a path from an agent response work in the TUI? #60175

Open

Description

@spaxe-dev

Quality-of-life improvement. Agent responses usually end with a list of files. In the TUI those paths are plain text, so opening one means selecting it with the mouse, copying it, switching to an editor, pasting it, and finding the line by hand. Terminal mouse selection also varies between terminals, tmux, and SSH. The line and column are already in the response, so the information is there but not usable.

Existing demand

This is not a new idea. It has been asked repeatedly across the TUI and desktop UIs:

The common ask is the same: a path the agent printed should be actionable where it is printed, without copy and paste. This issue is about the TUI interaction. A combined implementation was proposed in #60048; it was closed as too large, with a request to agree on the interaction first and split the work. This issue is that agreement step.

What would help

A keyboard path from "the response says this file" to "the file is open at that line", without leaving the TUI, on Linux, macOS, and Windows.

Numbered paths in the last response, with the picker bar open

Multi-select with selection dots

Constraints

  • Only existing paths should be actionable. Relative names that do not exist stay plain text. Explicitly rooted missing paths can be listed so the reader gets a clear does-not-exist message instead of silence.
  • A path is never passed through a shell.
  • Executable file types (.exe, .bat, .cmd, .desktop, .app, and similar) are not launched by the OS handler by default. $VISUAL or $EDITOR can still open them as text.
  • Markdown structure, fenced code, inline code, URLs, and prose should keep rendering as they do now.
  • No global key takes over. The feature starts behind /paths with an optional keybinding that goes through the existing leader-key configuration.
  • Editors differ. The VS Code family accepts --goto file:line:column, Sublime and Zed accept file:line:column, vim accepts +line, and terminal editors need the renderer to suspend.

Options considered

  1. Keyboard picker on /paths. Number every path in the last completed response, type the number to open it, and extend the same surface with multi-select. No mouse support required.
  2. Mouse clickable paths in the transcript, through OSC 8 links or mouse hit testing. Terminal support and tmux/SSH behavior vary, so this would be a separate effort. It could complement the picker later.
  3. One key that opens the first file. Too limited when a response touches several files, and ambiguous about which path is first.

Proposed direction

Option 1, split into five reviewable parts:

  1. Basic picker: scan the last completed response, number common path shapes, open one selection in $VISUAL or $EDITOR at the line, fall back to the OS handler.
  2. Multi-select: m, numbers toggle, a selects up to 10, enter opens the selection. Group several files into one editor process when the editor accepts several targets.
  3. More path shapes: Windows drive and UNC paths, file:// URLs with #L12C3, quoted paths with spaces, Markdown link targets, and inline code.
  4. Tag styling: concealed tags with red selection dots, without adding a theme token. Links and inline code keep their own colors, and the transcript returns to normal when the picker closes.
  5. Storybook story for repeated manual checks.

The five parts are ready locally. Part 1 opens after this issue; each following part opens as its parent merges, so every PR has a clean diff against dev.

Worked example

The response ends with:

Updated out/report.md and src/app.ts:12. Notes are in ./docs/.

The reader runs /paths. The transcript shows numbered tags in red while the picker is open, and the picker bar appears:

Updated out/report.md 1 and src/app.ts:12 2. Notes are in ./docs/ 3.
● Paths 3 · type a number · esc close

Typing 2 opens src/app.ts in the editor at line 12. Pressing m turns the tags into selection dots, and then 1, 2, enter opens both files in one editor process when the editor accepts several targets, or one process per file otherwise.

For a missing rooted path, the number is still shown. Choosing it reports that the path does not exist instead of opening anything.

Questions for maintainers

  • Is /paths the right command name, and is <leader>f an acceptable default keybinding?
  • Is numbering inside the rendered response acceptable when the numbers are concealed with ~~...~~ and shown in red only while the picker is open?
  • Should directories open in the file manager, or be listed without opening?
  • Is a cap of 10 on multi-select reasonable?
  • Is the five-part split the right review shape?

Activity

  1. opencodejr commented on Oct 29, 2026

    @opencodejr
    Contributor

    Thanks for the detailed proposal and for splitting the work after #60048 was closed. To restate it: you're suggesting a keyboard /paths picker for the TUI. It would number the file paths in the last completed response and open the chosen ones in $VISUAL/$EDITOR at the right line, or with the OS handler, and support multi-select. You're also asking maintainers to decide the interaction questions before the parts are reviewed.

    Maintainers will look at it and at your questions about the command name, keybinding, in-transcript numbering, directories, the multi-select cap and the five-part split. This doesn't commit to any particular direction.

    Related issues, for context:

  2. spaxe-dev commented on Oct 29, 2026

    @spaxe-dev
    Author

    Part one is ready for review: #60178. It adds /paths and the session.file_links keybinding (<leader>f) with single-path opening, editor line and column support, and an existing-path check. CI is green, and the review bot's three earlier findings are fixed.

    The interaction questions from the issue are still open, and parts two to five depend on them:

    • Is /paths the right command name, and is <leader>f an acceptable default, or should it stay unbound?
    • Are in-transcript tags acceptable when they are concealed and only visible while the picker is open?
    • Should directories open in the file manager, or only be listed?
    • Is a cap of 10 on multi-select reasonable?
    • Is the five-part split the right review shape?

    Parts two to five (multi-select, more path forms, tag styling, storybook story) are built and tested on top of part one locally. I will open them one at a time as each parent merges, or adjust them if the answers point another way.

  3. spaxe-dev commented on Nov 4, 2026

    @spaxe-dev
    Author

    Bump after a week: part one is ready and green, #60178.

    The interaction questions above are the only thing holding the direction. A quick preference on the command name and the <leader>f default would be enough to unblock the follow-up parts. If the split shape is wrong, say so and I will reshape it.

    One housekeeping note: the branch base is now 342 commits behind dev. I can rebase it before review or after the questions are answered, whichever you prefer.

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

Metadata

Metadata

Assignees

No one assigned

    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