jeudi 29 janvier 2015

tmux: variables sharing between sessions


I've noticed that



  1. tmux will share variable between sessions.

  2. tmux will increment TMUX_PANE for new session as well.


Is it possible to reset VAR for each session?


Is it possible to start TMUX_PANE from 0 for each session?



# set variable
# create 2 sessions
$ export VAR=aaaaa
$ tmux new -A -s $VAR -d

$ export VAR=bbbbb
$ tmux new -A -s $VAR -d

$ tmux ls
aaaaa: 1 windows (created Fri Jan 23 12:12:46 2015) [207x50]
bbbbb: 1 windows (created Fri Jan 23 12:12:55 2015) [207x50]

# connect to sessions
# check value of variable
$ tmux att -t aaaaa
$ echo $VAR
aaaaa

$ tmux att -t bbbbb
$ echo $VAR
aaaaa <-------- i would like to see 'bbbbb' here


Aucun commentaire:

Enregistrer un commentaire