title: How to write a shell script that starts tmux session, and then runs a ruby script
body: <p>I want to write a shell script that does this:</p>
  
  <ul>
  <li>First, create a tmux session</li>
  <li>Second, run a ruby script called "run.rb" INSIDE the tmux session</li>
  </ul>
  
  <p>In pseudo-code, what I want to do:</p>
  
  <pre><code>tmux new -s my_session
  ruby run.rb     # NOTE: I want this to run inside the my_session tmux session.
  tmux detach
  </code></pre>
  
  <p>How do I do this? (More posts I read, more confusing it gets.)</p>