From f748c2e6196fd100e096aaae972c08f9b3e313de Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Sun, 18 Oct 2026 09:29:00 -0400 Subject: [PATCH] feat(links): forward OSC 8 hyperlinks, ctrl+click opens them --- tmux.conf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tmux.conf b/tmux.conf index 60fa2be..98b093f 100644 --- a/tmux.conf +++ b/tmux.conf @@ -116,6 +116,15 @@ set -ag terminal-features "xterm-kitty:extkeys" # extended keys. bind -N "Shift+Enter as CSI-u" -n S-Enter send-keys -H 1b 5b 31 33 3b 32 75 set -as terminal-features ",*:clipboard" +# OSC 8 hyperlinks: tmux keeps the links programs print and forwards them to +# Ghostty (apply with `tmux kill-server`, not a reload). With `mouse on` +# Ghostty's own ctrl+click never fires (tmux gets the click), so tmux opens +# the OSC 8 link under the mouse itself; any other ctrl+click goes to the +# pane. Plain-text URLs: ctrl+shift+click (Ghostty). +set -as terminal-features ",*:hyperlinks" +bind -N "Open hyperlink under mouse" -n C-MouseDown1Pane if -F '#{mouse_hyperlink}' \ + 'run-shell -b "if command -v xdg-open >/dev/null; then xdg-open #{q:mouse_hyperlink}; else open #{q:mouse_hyperlink}; fi >/dev/null 2>&1"' \ + 'select-pane -t = ; send-keys -M' set -sg escape-time 10 # Status bar