In a shell inside tmux invoke
tmux show-option -s terminal-features
In my case the above command prints:
terminal-features[0] xterm*:clipboard:ccolour:cstyle:focus:titleterminal-features[1] screen*:titleterminal-features[2] rxvt*:ignorefkeys
The first entry means that if my $TERM
when starting a tmux client matches xterm*
(e.g. it's xterm-256color
) then inside tmux the command tmux display -p "#{client_termfeatures}"
will print a comma-separated string containing (but not necessarily limited to) entries clipboard
,ccolour
,cstyle
,focus
and title
.
If I want to add hyperlinks
to this array, I need to invoke
tmux set -as terminal-features 'xterm*:hyperlinks'
Then I have to detach the client (prefixD, where prefix is by default Ctrl+B) and attach anew (tmux a
). Then tmux display -p "#{client_termfeatures}"
will include hyperlinks
.
In ~/.tmux.conf
the line will be:
set -as terminal-features 'xterm*:hyperlinks'
In practice this method does not give me the hyperlink support because my setup without tmux does not support hyperlinks anyway. I understand you've got it covered, so the method should work for you. But you need to adjust the line to $TERM
your tmux client will see. E.g. if your $TERM
outside tmux is gnome-256color
then use gnome*
instead of xterm*
.
You can even use *
instead of xterm*
to make tmux enable hyperlinks
for any value of $TERM
seen by the client. It will be like using -T hyperlinks
unconditionally. I'm not sure what can go wrong if you enable the feature in tmux when the terminal of the tmux client does not support it. Settings things up in a way that only enables hyperlinks
when hyperlinks are really supported seems neater.