feat(links): forward OSC 8 hyperlinks, ctrl+click opens them

This commit is contained in:
Prad Nukala committed 2026-10-18 09:29:00 -04:00
1 parent 4390a5b8b6
commit f748c2e619
1 file changed
+9
+9
View File
@@ -116,6 +116,15 @@ set -ag terminal-features "xterm-kitty:extkeys"
# extended keys. # extended keys.
bind -N "Shift+Enter as CSI-u" -n S-Enter send-keys -H 1b 5b 31 33 3b 32 75 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" 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 set -sg escape-time 10
# Status bar # Status bar