Tmux not displaying bash prompt colors

tmux $PS1 bash prompt after

Here is a screenshot of my terminal when I open tmux:

tmux PS1 prompt before

Note: Here, my shell displays my username@hostname but it does not display it in colors  🙁

To make tmux read your bash colors, edit your tmux configuration file:

vim ~/.tmux.conf

Add the following line to the tmux config file:

set -g default-terminal "screen-256color"

Exit and save the file. Close and re-open tmux.

Now, when you open tmux you should be able to get your regular bash prompt colors. Here is a screenshot after re-opening tmux:

 

tmux $PS1 bash prompt color after modying tmux.conf

Hope this helps! Cheers!

 

Source: Link

10 thoughts on “Tmux not displaying bash prompt colors

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.