In iTerm2 Command Click on URLS does not work when inside a tmux session
質問
When not inside a tmux session, Command-Click
on URLs works flawlessly.
How can I make links clickable in iTerm2 when inside a tmux session?
When hitting Command
the mouse pointer changes to the icon, but when clicking on an URL, nothing happens.
Note I have the following settings inside my .tmux.conf
[...]
# Enable mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# Mouse pane switching
set-option -g mouse-select-pane on
[...]
Disabling them and then reloading .tmux.conf
does not resolve the issue.
iTerm2 Version is Build 1.0.0.20140629
tmux -V 1.9a
解決
To use the normal mouse behavior in tmux
you have to keep alt
pressed. So click on the link while pressing cmd
+alt
. The same applies when selecting text.
他のヒント
I ran into this issue today. I would command-click on a URL in iTerm2 (Mac) and the app would seemingly lose focus but the link wouldn't open in a browser (Chrome, in my case). This used to work fine for me so I was a little confused and the other answers here didn't work for me.
It seemed to me that Chrome was "trying" to open but failing for some reason. I ran ps -ax | grep -i chrome
to get a list of the Chrome or Chrome-related processes that were running and sure enough there was a process running that didn't correspond to an application that I was actively using.
Long story short, I killed all the Chrome-related processes and command-click worked again.
The top answer may work when using regular tmux, but it will not work when using iTerm2+tmux integration with the -CC
option. For Cmd+Click to use your "Semantic History" Profile Preference, you have to install iTerm2 Shell Integration. Also I have found it best to create a seperate .tmux.conf.iterm
with tmux integration, then create aliases for creating and attaching integrated sessions.
alias tcs="tmux -f ~/.tmux.conf.iterm -CC new -s"
alias tca="tmux -f ~/.tmux.conf.iterm -CC attach -t"
The only think in my ~/.tmux.conf.iterm
file is set-option -g default-terminal screen-256color