Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop making tmux auto setting RBENV_VERSION

tmux is auto setting RBENV_VERSION when I start tmux...

Anyone know how to stop it?

Because it auto sets it, I need to do

$ export RBENV_VERSION

to unset it and make .ruby-version work. Thx.

like image 781
Takehiro Adachi Avatar asked Feb 21 '13 13:02

Takehiro Adachi


Video Answer


1 Answers

tmux itself will never set (or unset) RBENV_VERSION of its own accord. You have some bit of configuration that is causing this.

My guess is that RBENV_VERSION was set when you started your tmux server and that is is now part of the tmux “global environment” (the base environment inherited by all the processes started by tmux). You can check this

tmux show-environment -g | grep RBENV

If it is present there, you can delete it with this command:

tmux set-environment -gu RBENV_VERSION

If you often find yourself starting tmux when RBENV_VERSION is already set (and you do not want it sent “inside” tmux), then you can add the above command to your ~/.tmux.conf file to make sure that it is cleared every time you start a server.

Another possibility is that it is part of your tmux “session environment”; this environment is “layered” atop the global environment to form the environment that is inherited by the processes started for new windows and panes in a session. You can check it with this command (run it inside the session, or add -t sessname to specify a session):

tmux show-environment | grep RBENV

If this is present, you can unset it in a similar way:

tmux set-environment -u RBENV_VERSION

Finally, if the variable is not present in either the global or session environments, then it is probably coming from something in your shell initialization files. By default, tmux starts login shells, so be sure to check the corresponding bits of shell configuration (e.g. .bash_profile, .bash_login, .profile, etc.) as well as any other bits of initialization.

like image 155
Chris Johnsen Avatar answered Nov 15 '22 21:11

Chris Johnsen