0

In my .bash_profile, I have a line to start tmux only if it is present on the system with:

[ -z $TMUX ] && export TERM=xterm-256color && exec tmux

In a similar vein, I would like to skip or include certain lines:

• Have certain lines in my .bash_profile that only run during a tmux session start.

• Have certain lines in my .bash_profile that do not run during a tmux session start.

What would the syntax be to achieve this?

YorSubs
  • 135
  • 6

1 Answers1

0

It's wrong because -z will return true if the environment variable have an empty value. So you have to use instead :

[ ! -z $TMUX ] && export TERM=xterm-256color && exec tmux

Where the exclamation (!) mark negate the conditional test.

Reda Salih
  • 231
  • 2
  • 7