Discussion:
sessions should be nested with care, unset $TMUX to force
Mariusz.makowski
2013-06-04 08:52:25 UTC
Permalink
How can i rid of the message:

sessions should be nested with care, unset $TMUX to force
sessions should be nested with care, unset $TMUX to force


Wheever i start Tmux, i get this message.
i am not starting tmux inside another tmux.
Thomas Adam
2013-06-04 10:00:30 UTC
Permalink
Post by Mariusz.makowski
sessions should be nested with care, unset $TMUX to force
sessions should be nested with care, unset $TMUX to force
Wheever i start Tmux, i get this message.
i am not starting tmux inside another tmux.
Then the shell that an instance of tmux has started from is propagating that
value down to each shell. So you must be starting tmux from _somewhere_ --
or you've set TMUX somewhere manually.

-- Thomas Adam
simfox3
2013-06-04 15:10:40 UTC
Permalink
Mariusz,
Are you starting tmux on shell login (.bashrc/.bash_profile)? Each pane in
tmux runs as if launched at login--meaning they execute .bash_profile /
.bashrc. Fortunately, by default, nested tmux sessions are not allowed, but
wrap your tmux execution in a conditional to prevent the pane from even
trying to create a nested session.

Last lines from my .bash_profile:

if [[ "$TERM" != "screen-256color" ]]; then
exec tmux -S /var/tmux/$USER new-session -A -s "$USER"
fi

-Saad
Post by Thomas Adam
Post by Mariusz.makowski
sessions should be nested with care, unset $TMUX to force
sessions should be nested with care, unset $TMUX to force
Wheever i start Tmux, i get this message.
i am not starting tmux inside another tmux.
Then the shell that an instance of tmux has started from is propagating that
value down to each shell. So you must be starting tmux from _somewhere_ --
or you've set TMUX somewhere manually.
-- Thomas Adam
------------------------------------------------------------------------------
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Mariusz.makowski
2013-06-05 08:48:10 UTC
Permalink
Post by simfox3
Mariusz,
Are you starting tmux on shell login (.bashrc/.bash_profile)? Each pane
in tmux runs as if launched at login--meaning they execute .bash_profile
/ .bashrc. Fortunately, by default, nested tmux sessions are not
allowed, but wrap your tmux execution in a conditional to prevent the
pane from even trying to create a nested session.
if [[ "$TERM" != "screen-256color" ]]; then
exec tmux -S /var/tmux/$USER new-session -A -s "$USER"
fi
-Saad
Saad, thanks much.

I did change to my file based on yours and now it work perfectly

if [[ $SHLVL != "2" ]]
then
tmux -S /var/tmux/$USER new-session -A -s "$USER"
fi

Although i think SHLVL will do make more use for me, i am setting
TERM=screen-256color for nontmux connections (like from my desktop where
i already have tmux running on gnome-terminal)
Mariusz.makowski
2013-06-05 08:50:43 UTC
Permalink
Post by Thomas Adam
Then the shell that an instance of tmux has started from is propagating that
value down to each shell. So you must be starting tmux from_somewhere_ --
or you've set TMUX somewhere manually.
-- Thomas Adam
Thanks Thomas,

i found .login file has:

tmux attach || tmux new

And it was executed every time i want to start tmux manually or split
pannel.

Loading...