This neitherdoesn't directly answer your question, but have a look at tmux-yank, as described in Use system clipboard in vi-copy mode in tmux and Getting tmux to copy a buffer to the clipboard. After installing,
prefix + y- copies text from the command line to clipboard.
copy mode bindings:
y- copy selection to system clipboard