I'm just trying to pass current zsh environment to tmux session. I have RUST_BACKTRACE=1
in .zprofile
. I did like below.
Create a new session like below.
tmux new -d -s ipython ipython
Attache to the session.
Then check what environment variables it has.
In [1]: import os
In [2]: os.environ.copy()
Out[2]:
(No RUST_BACKTRACE environemnt.)
Apparently, the environment variable is not same as zsh's ones. Is there any way to make tmux load .zprofile
or something like that kind of file?
tmux new -d -s ipython zsh -c "source .zshrc;ipython"
– fx-kirinprintenv RUST_BACKTRACE
), right before doing thetmux
, that this environment variable exists. – user1934428tmux
. The server inherits your environment when it is first started. After than, any new session inherits its environment from the server, not the environment of your client when you reattach. Theupdate-environment
session option lets you specify a list of environment variables which the client should request the server to update for that session. – chepner