I am trying to send a message to a running tmux window that is side by side, to tell it to run a script when I press a button. What I am trying to do is done by doing:
silent !tmux send -t 0.1 ruby test.rb ENTER
Which will silently run the script. However, the display goes blank or glitches whenever I run this, and I than need to run the redraw! command to display the buffer again.
What would be the best way to convert these commands into a function?
:silent !tmux send -t 0.1 'ruby test.rb ENTER'
:redraw!
so far I have tried doing the following, but I seem to be messing up somewhere:
silent !tmux send -t 0.1 ruby test.rb ENTER <CR> redraw! <CR>
silent exec "tmux send -t 0.1 'ruby test.rb ENTER' | redraw!"
Overall, I am wondering what the best way to achieve sending messages to a tmux window would be and if this is a somewhat correct method, what is the proper way to build a vim function peicing that together?