you will notice that you are not able to select text at all.
the solution is to use the shift key.
hold down the shift key and then left click and drag across the target text. you must also hold down the shift key and then middle click in order to paste the text.
press the left mouse button and hold it, select text in pane and still hold the button down. then press "y", which saves selection within clipboard and escapes from selection/copy mode.
works here with iTerm 3.1.beta.5, tmux 2.5 and the following config:
### copy & paste -------------------------------------------------------
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
I was able to solve this problem with CMD+C after selecting the text with FN+mouse drag with left button down from tmux window in Terminal app of macOS High Sierra.
A robust solution that works with any combination of mosh + tmux + vim + nested sessions
After spending many days tackling this, by far the most robust solution I've discovered is Suraj N. Kurapati's posted solution. The solution works locally with (and without) tmux v3.2 and/or vim, as well as remotely with (and without) tmux and/or vim, using both copy-mode keys and simple mouse selection.
If combined with Mike Gulick's (currently open) pull request, all of these combinations work with mosh as well.
Until Mike's solution is merged into mosh, you can pull his changes and build locally using:
I think you need to install Apple's Xcode/Developer Command Line Tools first (which, IIRC, can now be done by simply running gcc and exiting), then running:
On macOS Terminal Tmux, copying from a specific pane:
Hold option (cursor changes to crosshair) [See * below]
Click and drag to select text
Copy/paste as normal, with CMD-C/V
*You may need to toggle "Allow mouse reporting" with CMD-R (see Terminal, View-...). I find that I often toggle this to either scroll with mouse inside tmux panes, or to copy-paste.
monterey macosx terminal 2.21 with default settings connected to a machine over ssh with tmux 2.6 running on it, with several panes, tmux config there is as simple as that:
set -g mouse on
To copy - hold the 🌐 Fn button and select what you need using mouse, then press ⌘ Command + C, et voila, the text is in the buffer on your mac.