Re:St – A simple terminal implementation for X
by fpqc on Thursday February 02, 2017 @10:52AM
(#13551351)
I just added a feature to tmux-git that makes the tmux clipboard propagate up into higher clipboards for nested tmux. https://github.com/tmux/tmux/commit/4ede35c48c089abe3fca0d94...
Keep in mind that your terminfo has to support this, so make sure your ncurses-term package is the latest release from Jan 28.
I also made a patch for st to support OSC 52 propagation into Xorg, but it was rejected by the st maintainers because it uses base64 (as the OSC de-facto spec from xterm dictates).
The patch for st is however in a branch of the Wayland-fork of st
https://github.com/michaelforney/st/tree/selection
Another option if you use nested copies of tmux is to use this feature to get the remote clipboard into the local one, then yank with xclip.
Also, I always use mosh for ssh (when possible) so that I can recover my connection if I run into network issues. Since mosh works by synchronizing a virtual screen, I don't get scrollback at all without tmux or the like.