Skip to content

Feature: Semantic History — resolve bare filenames against OSC 7 CWD on Cmd+click #2199

Description

@jiseongnoh

Feature Request

When a bare filename (e.g. README.md, src/main.py) appears in terminal output, Cmd+clicking it should resolve it against the current working directory (known via OSC 7) and open it if the file exists.

This is the single biggest workflow gap between cmux and iTerm2 for AI coding agent users.

Current behavior

  • https://google.com → clickable ✅ (URL pattern auto-detected)
  • /Users/krust/project/file.md → clickable ✅ (absolute path detected)
  • file.md → not clickable ❌ (not recognized as a file)
  • src/components/App.tsx → not clickable ❌

Expected behavior

  1. User Cmd+clicks file.md in terminal output
  2. cmux already knows CWD via OSC 7 (e.g. /Users/krust/project)
  3. cmux checks: does /Users/krust/project/file.md exist?
  4. Yes → open in default editor (or cmux markdown panel for .md)
  5. No → fall through to current behavior

Why this matters

AI coding agents (Claude Code, Codex, etc.) constantly output bare filenames:

I've updated the following files:
  proposal_draft.md
  workflow_v2.md
  src/coordinator.ts

In iTerm2, every one of these is Cmd+clickable via Semantic History. In cmux, none of them are. This is the #1 reason some users stay on iTerm2 instead of switching to cmux full-time.

Technical context

Suggested approach

On Cmd+click of any non-URL text:

  1. Get CWD from last OSC 7 report
  2. stat(CWD + "/" + clicked_text) — does the file exist?
  3. If yes and has line number suffix (e.g. file.md:42), open at that line
  4. If yes, open via system handler (or cmux internal panel for supported types)
  5. If no, fall through to existing behavior

Environment

  • cmux nightly
  • macOS 15.5 (Darwin 24.6.0)
  • Primary use case: Claude Code AI coding agent

Activity

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

    area: terminalGhostty surface, rendering, scrollback, escape sequences, fontsarea: workspacesWorkspaces, sessions, restore after relaunch, worktrees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions