Skip to content

[codex] Open plain URLs inside tmux#8

Merged
gsantovena merged 1 commit into
mainfrom
codex/fix-tmux-url-clicks
May 10, 2026
Merged

[codex] Open plain URLs inside tmux#8
gsantovena merged 1 commit into
mainfrom
codex/fix-tmux-url-clicks

Conversation

@gsantovena

Copy link
Copy Markdown
Owner

Summary

  • Open both OSC 8 hyperlinks and plain-text URL words from tmux mouse clicks.
  • Keep tmux mouse mode enabled and forward non-link clicks back to tmux normally.
  • Add a small tmux URL opener helper that trims surrounding punctuation and supports http(s), mailto, file, ssh, git, and www.* links.
  • Add regression coverage for the tmux binding, opener normalization, and tmux config parsing outside an already-running tmux server.

Root cause

The previous fix handled #{mouse_hyperlink} only, which works for OSC 8 hyperlinks. Most terminal output prints plain URL text, and with tmux mouse mode enabled Ghostty never receives the click directly. tmux must therefore detect the clicked mouse_word and open URL-shaped words itself.

Validation

  • git diff --cached --check
  • make check

Notes

~/.config/tmux is already symlinked to this repo, but no tmux server was running from this surface, so I could not live-reload the active client here. After merging/pulling, run tmux source-file ~/.config/tmux/tmux.conf in an active tmux session or restart tmux.

Ghostty can detect ordinary URL text only when tmux does not consume the mouse event. Because mouse mode is required, tmux now keeps URL punctuation in mouse_word, opens both OSC 8 hyperlinks and plain URL words through a small helper, and forwards non-link clicks back to tmux normally.

Constraint: Mouse mode must stay enabled for scrolling, pane selection, and mouse-aware TUIs.

Constraint: URL clicks need to work for plain terminal text, not only OSC 8 hyperlinks.

Rejected: Disable tmux mouse mode | it would restore terminal-native clicking but break tmux mouse workflows.

Rejected: Open every mouse_word | non-URL clicks must preserve normal tmux behavior.

Confidence: high

Scope-risk: narrow

Directive: Keep the MouseDown1Pane fallback path forwarding to tmux when the click is not on a URL.

Tested: git diff --cached --check

Tested: make check

Not-tested: Manual click in a freshly reloaded tmux client.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@gsantovena gsantovena marked this pull request as ready for review May 10, 2026 05:28
@gsantovena gsantovena merged commit 7425099 into main May 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant