title: tmux - Environment variables don't show up in session
body: <p>I'm trying to move from screen to tmux (to eventually using tmux from within byobu). However, I have a severe problem with environment variables not being applied, especially PS1. None of them get copied to the <em>session</em> (or window) environments. I found this thread that seemed relevant:</p>
  
  <p><a href="https://stackoverflow.com/questions/8645053/how-do-i-start-tmux-with-my-current-environment">How do I start tmux with my current environment?</a></p>
  
  <p>However, I actually <em>can</em> see all my right variables when I do </p>
  
  <pre><code>:show-environment -g
  </code></pre>
  
  <p>But none of them get carried over to the session environment, so I don't see anything when I do</p>
  
  <pre><code>:show-environment
  </code></pre>
  
  <p>I do have the right <code>update-environment</code> statement in my <code>~/.tmuxrc</code> file:</p>
  
  <pre><code># start a non-login shell by default for each new window
  set -g default-command 'bash'
  
  # Prefix is C-a like in screen
  unbind C-b
  set -g prefix C-a
  
  # Carry over the PS1
  set-option -ga update-environment "PS1"
  </code></pre>
  
  <p>Frankly this all seems like a mess to me. I can see the benefit of starting from a clean session for each screen, but for the most part this seems like a pain. I export the variable I intend to use in sub-processes, such as as the Python virtualenvwrapper functions, and expect them to be available.</p>
  
  <p>Is there a way to disable this behavior? If not, what should I try to carry over my PS1 variable to tmux?</p>
  
  <p><strong>EDIT 11/13/2013</strong></p>
  
  <p>I realized that removing the first line (<code>default-command bash</code>) <em>does</em> carry over all of the environment variables. However, I really don't want each new screen of tmux to launch as a login shell. For instance, I specifically declared my PS1 variable in a login shell, so that it wouldn't be overwritten whenever I open a new screen.</p>
  
  <p>Based on the following post, every new screen in tmux should launch as a non-login shell:
  <a href="https://superuser.com/questions/614277/profile-and-bash-profile-ignored-when-starting-tmux-from-bashrc">https://superuser.com/questions/614277/profile-and-bash-profile-ignored-when-starting-tmux-from-bashrc</a></p>
  
  <p>Why is this not happening by default for me?</p>