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.

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: pgpW0gnr6R7u2.pgp
Description: OpenPGP digital signature

Reply via email to