I was getting sessions should be nested with care, unset $TMUX to force at the top of tmux when using tmux attach || tmux new. What happens is tmux also executes .bashrc/profile.
So now I use this:
if [[ ! "$TERM" =~ "screen" ]]; then
tmux attach -t default || tmux new -s default
fi
in my .bashrc
TERM is set to 'screen' in tmux environment.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I was getting
sessions should be nested with care, unset $TMUX to force
at the top of tmux when usingtmux attach || tmux new
. What happens is tmux also executes .bashrc/profile.So now I use this:
if [[ ! "$TERM" =~ "screen" ]]; then
tmux attach -t default || tmux new -s default
fi
in my .bashrc
TERM is set to 'screen' in tmux environment.