I want to have two tmux panes going - the first could have one of several programs in it (often, but not always, vim) and the second will have an interactive session in R, python, or bc.
The two panes aren't always going to be showing the same system - usually I'll be running tmux on system A, doing something in one pane there, but then have the second pane ssh'd to system B and running an interactive session of R/Python/bc there.
My goal is to be able to highlight something in the first pane, and have it sent and executed in the other pane.
I know tmux can copy/paste between panes. And I know tmux can send-keys a specific command to another pane and end it with an enter so it is executed. But can I make it send-keys "whatever I have highlighted in the first pane" to the second pane then end with the enter character for execution?
(In other words, I'm trying to emulate the behavior of an IDE, where you can highlight a block of code and click "run". I am looking to do this specifically using tmux, not a special vim plugin, because sometimes I'll be using something other than vim in the first pane.)