
What am I doing wrong :O ? Installed powerline and it looks like this :/ And why don't I have any colors in my bash?
Thanks for the conf file!
Hello,
Quit tmux and then make sure make sure TERM is set to xterm-256color.
Its set to the correct value. I am using Gnome Drop Down Terminal, but the problem also occurs in Terminator.
Thanks for the fast response!
I tried removing tmux from the option "Run a custom command instead of my shell" in both terminals and when I manually run tmux the display and colors are as intended. Is this normal behavior? Any known workaround?

I'm not using Gnome Drop Down Terminal nor Terminator.
Though if you just relaunched tmux and you're getting a session numbered 9 then definitely all tmux processes were not killed. Try to kill all and start over?
In any case to me it's all about setting TERM correctly outside of tmux.
After a bit of messing around the problem seems to be that the value of $TERM isn't being correctly passed to the terminal when running the command instead of the shell. For terminator the fix is to either run
TERM=xterm-256color && tmux
or to set it to run the command as the login shell.
As for gnome dropdown terminal, it crashes when trying the above command.
Either way the problem seems to be with the terminals them selves, not your config file. Thanks for the help! Closing.
Reopening cause I found out that I actually have no color in my bash, I have colors down in tmux however, is this a part of your script?
When I say colors I am referring to PS1, Directory colors, etc...
I would say this has nothing to do with this configuration as I don't touch PS1, aliases etc... It seems you're not launching your shell properly?
Well now that I think about it, tmux manual says
default-shell path
Specify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable. When started tmux tries to set a default value from the first suitable of the SHELL environment variable, the shell returned by getpwuid(3), or /bin/sh. This option should be configured when tmux is used as a login shell.
And I'm making use of $SHELL when setting default-command. So you may want to check that $SHELL is also properly defined.
Or use your ~/.tmux.conf.local copy to define default-shell
Please give the default-command branch a try and near the end of your ~/.tmux.conf.local copy, add something like set -g default-shell /bin/bash.
Gave it a try. Didn't work. The output if $SHELL is/bin/bash, so that is correct, reloaded, killed all tmux instances, tried in different terminals, all a no go. I am running Ubuntu 16.04. with Gnome if that is of some importance.
"Does it work" with another tmux configuration?
Nope. Doesn't work at home with Fedora Gnome nor at work with Ubuntu Gnome. I will test it out today on KDE Neon and report back.
So to be clear, you're trying to use tmux as your login shell? This is not something I have tried but as far as Google tells me people are rather amending their ~/.bashrc with something like
[ -z "$TMUX" ] && tmux
Setting that in bashrc fixes the colors in the bottom in every terminal I have tried, however, the PS1 and Directory colors are still missing :/
And if you're using tmux without using my conf, are PS1 etc correct?
Without your conf, everything is correct.

Can you please take an equivalent screenshot with my conf?

Is this bash ?
I just tried in Terminator, and I'm using tmux -2 as a launch command and everything looks ok for me.
It looks like your ~/.bashrc is not sourced properly. Can you make sure it's sourced by e.g. putting echo "~/.bashrc sourced!" at the end of ~/.bashrc ?
Yes, it is bash. It was owned by root for some reason, seems I accidentally added sudo to vim when making the .bash. It sourced out even when owned by root.



Ignore the 6 tmux instances, couldn't kill when taking the screenshot because I was doing something in another tab but I killed all after and its still the same :/
Can you screenshot your terminal settings as well, so that I can understand how you're launching tmux ?
Just using the default gnome terminal, nothing changed, just the theme in general (Arc Theme) but that shouldn't effect anything, any particular setting you are interested in? I am using the bash configuration from HERE if that is of any help.
I'm interested in how you launch tmux.
At the moment I use your solution from top [ -z "$TMUX" ] && tmux
And I tried launching via the tmux command, and inserting it as a custom launch command in terminal settings. The result is the same no matter what method I use
Alright it's all about the way you customized your ~/.bashrc. You need to make sure it applies colors when TERM is screen-256color (the proper TERM value when being inside tmux).
Thanks for the help with this, but I am afraid I don't understand your answer. Do I need to set TERM=screen-256color after tmux is launched?
Generally speaking, for colors to work properly in tmux, TERM must be set to xterm-256color outside of tmux. And then in .tmux.conf people do set -g default-terminal "screen-256color". This is already done by my conf so right now inside a tmux session echo $TERM should already report screen-256color.
Here's what's (likely, provided you copy pasted the conf from the link you mentioned) happening in your case:
bash and TERM is either xterm or xterm-256color depending on the configuration of the terminal emulator~/.bashrc is sourced and applies colors~/.bashrc, [ -z "$TMUX" ] && tmux spawns tmuxtmux creates a pane, it spawns bashTERM is set to screen-256colorTERM is set to screen-256colorAll in all, I would use the following ~/.bashrc
# outside of tmux, make sure TERM is xterm-256color
[ -z "$TMUX" ] && export TERM=xterm-256color
...
# customize colors
# make sure you handle both TERM=xterm-256color and TERM=screen-256color cases
...
# if not inside tmux already, replace current bash process by tmux
[ -z "$TMUX" ] && exec tmux
Hope that helps.
Cheers. That did the trick! The whole problem by the way was that in /etc/DIR_COLORS I didn't have TERM=screen-256color set and
[ -z "$TMUX" ] && export TERM=xterm-256color
[ -z "$TMUX" ] && exec tmux
additionally fix the status bar colors inside tmux. Thanks once again for the plugin and for the excessive help! :+1:
Most helpful comment
Generally speaking, for colors to work properly in
tmux,TERMmust be set toxterm-256coloroutside oftmux. And then in.tmux.confpeople doset -g default-terminal "screen-256color". This is already done by my conf so right now inside atmuxsessionecho $TERMshould already reportscreen-256color.Here's what's (likely, provided you copy pasted the conf from the link you mentioned) happening in your case:
bashandTERMis eitherxtermorxterm-256colordepending on the configuration of the terminal emulator~/.bashrcis sourced and applies colors~/.bashrc,[ -z "$TMUX" ] && tmuxspawnstmuxtmuxcreates a pane, it spawnsbashTERMis set toscreen-256colorTERMis set toscreen-256colorAll in all, I would use the following
~/.bashrcHope that helps.