0
我只是試圖爲tmux會話設置shell env。起初,它像預期:tmux爲不同會話設置會話變量
export MY_VARIABLE=123
tmux new-session
# in session
echo $MY_VARIABLE
-> 123
現在我離開會話,並創建第二個:
tmux detach
echo $MY_VARIABLE
-> 123
export MY_VARIABLE=456
echo $MY_VARIABLE
-> 456
tmux new-session
# in new session
echo $MY_VARIABLE
-> 123
# list session to see it is really a new one
tmux list-sessions
-> 0: 1 windows ...
-> 1: 1 windows ... (attached)
如果我離開舊的會話(不分離),那麼它將按預期工作。看起來變量在會話之間同步?在啓動一個tmux會話後,我怎樣才能分解$ MY_VARIABLE?