Now tmux, mosh and iTerm2 support the OSC 52 sequence that enables clipboard sharing. However, there is a trap that prevents them from working together.
Mosh accepts OSC 52 sequences with the
c; option. However, tmux doesn't send that option when it emits OSC 52 sequences, which means you cannot use tmux and mosh together with the default configuration.
You can override the OSC 52 sequence generated by tmux by adding the following line to your tmux.conf.
set-option -ag terminal-overrides ",xterm-256color:Ms=\\E]52;c;%p2%s\\7"
Instead of using the default
%p1%s; is the option part, this configuration forces use
c; as the option value.
xterm-256color must be replaced with your