It would be better as a flag to paste-buffer or save-buffer to write it using OSC 52.
save-buffer is probably easier since it doesn't have a -t flag already so you could add "-t client" to tell it which client to write to. On Fri, Apr 28, 2017 at 02:50:23PM -0700, Suraj N. Kurapati wrote: > 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. -- 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.
