Hello,
I think a yank-buffer command would be useful for taking an existing
tmux buffer and writing its contents out to the clipboard via OSC 52.
For instance, I sometimes need to copy the contents of an older buffer
to my system clipboard, so I run choose-buffer to interactively select
the older buffer I want to copy and then copy its contents via OSC 52:
# using
https://github.com/sunaku/home/blob/master/bin/yank script
bind-key -n M-Y choose-buffer \
'run-shell "tmux save-buffer -b \"%%\" - | yank > #{pane_tty}"'
With a yank-buffer command, I could forgo the external OSC 52 logic and
simply rely on tmux's existing OSC 52 capabilities to perform the copy:
bind-key -n M-Y choose-buffer 'yank-buffer -b "%%"'
What do you think? If this seems reasonable, I can attempt a patch.
Thanks for your consideration.