title: delay tmux send-keys in vim function
body: <p>I have a shell script (lets name it <code>a.sh</code>) where I run a certain command. At some point this command needs user input. </p>
  
  <p>I have setup a vim key binding where I run <code>a.sh</code> in a tmux session. </p>
  
  <pre><code>function! CreateTmux()
      !tmux has-session -t mysession || tmux new-session -d -s mysession
      !tmux send-keys -t mysession 'a.sh' Enter
      " This should be delayed by a few seconds
      !tmux send-keys -t mysession 'my choice' Enter
  endfunction
  
  nnoremap &lt;F9&gt; :call CreateTmux()&lt;CR&gt;
  </code></pre>
  
  <p>I would like to make a delayed <code>send-keys</code> through tmux to the session to input my choice for the prompt as well. Here is my code. </p>
  
  <p>The limitations:<br>
  1. I hope to avoid blocking commands in vim so that I can continue working.<br>
  2. I can not edit a.sh so I can't make it pass without the prompt.<br>
  3. I don't have vim 8 and can't get it on the server that I am working on.</p>