Reputation: 21019
I've defined coloring in my .bash_profile
on my Mac OS X as follows:
# ls color alias
alias ls='ls -G'
# Colours
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
BLACK="\[\033[0;30m\]"
DARK_GRAY="\[\033[1;30m\]"
LIGHT_GRAY="\[\033[0;37m\]"
WHITE="\[\033[0;37m\]"
RED="\[\033[0;31m\]"
RED_BOLD="\[\033[1;31m\]"
YELLOW="\[\033[0;33m\]"
YELLOW_BOLD="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
GREEN_BOLD="\[\033[1;32m\]"
BLUE="\[\033[0;34m\]"
BLUE_BOLD="\[\033[1;34m\]"
CYAN="\[\033[0;36m\]"
CYAN_BOLD="\[\033[1;36m\]"
PURPLE="\[\033[0;35m\]"
PURPLE_BOLD="\[\033[1;35m\]"
BROWN="\[\033[0;33m\]"
# Terminal colours
export CLICOLOR=1
export XTERM=xterm-color
export LSCOLORS=BxFxCxDxGxegedabagacad
I've noticed also that when I use GNU-Screen (which is always), the coloring is very different. The red turns into yellow, orange turns into yellow, and anything between quotations turns from purple to green. This appears to happen in Emacs mostly since Emacs displays all kinds of different colors.
I also have a ps1 prompt which also displays my current git
branch in the directory. This does not change its color.
My first question is, where are those colors defined? Why and how does GNU-Screen change the colors? What's the best way to go about coloring my terminal?
My second question is, when I copied my .bash_profile
from my Mac OS X into a CentOS server I SSH into, the coloring was not the same. Does Mac use a different color code than CentOS? If so, how can I standardize my coloring in both?
Upvotes: 2
Views: 3291
Reputation: 8446
Your native terminal emulation and what screen thinks it is may not agree on the number of colors supported.
What is the value of TERM
before and after starting screen
?
What is the output of tput colors
in either case?
Report these for both the server and the Max OS terminal.
Thanks for reporting that. The server assumes there's support for more colors than OSX Terminal physically supports.
Try to overrule TERM on CentOS with TERM=xterm-color
, or remove any TERM setting from your rc files/profile on linux, and let the OS pick up the proper value from ssh.
Upvotes: 2