title: How do I start tmux with my current environment?
body: <p>Or at least the part of it, that makes sense.</p>
  
  <p>More specifically I have some environment variables, that have been exported by running a script, to create an adequate environment for the task at hand. When I run tmux these variables are nowhere to be seen, neither in the global or the session environment. Of course I can run this script again but ...</p>
  
  <p>I'd be satisfied if I could specify the particular vars in my <code>.tmux.conf</code> file however:</p>
  
  <pre><code>set-environment VAR $VAR
  </code></pre>
  
  <p>Does not do what I'd expect.</p>
  
  <p>Thanks in advance :)</p>
  
  <p>Ah, I think I know why.</p>
  
  <p>When starting a second session of tmux, say in another terminal, it copies the environment from the first one. The first one pretty much takes the current environment of the calling shell and adds some tmuxiness to it.</p>
  
  <p>My current workaround is just stopping and starting my tmux sessions when i need to change environment.</p>