I assume the shell is Bash.
In Ubuntu the skeletal (default) .bashrc
contains this or similar snippet:
# set a fancy prompt (non-color, unless we know we "want" color)case "$TERM" in xterm-color|*-256color) color_prompt=yes;;esac
Your ~/.bashrc
started as a copy of the skeletal one and it still contains the snippet (unless you edited it out, but you probably didn't).
Most likely in tmux your $TERM
is tmux
or tmux-256color
. tmux-256color
would be detected by the snippet and there would be no problem, so apparently in your case the value is tmux
(verify with echo "$TERM"
in a shell inside tmux).
To enable colored prompt when $TERM
expands to tmux
, edit your ~/.bashrc
, locate the snippet and change the relevant line to:
tmux|screen|xterm-color|*-256color) color_prompt=yes;;
(I included screen
to solve the same problem for GNU Screen in advance, in case you ever use it.)
Existing shells will not be magically fixed, but prompts in new shells (e.g. in newly created tmux panes) will be colored.