LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to configure Xterm colors if my xterm can support 256 colors (http://www.linuxquestions.org/questions/linux-software-2/how-to-configure-xterm-colors-if-my-xterm-can-support-256-colors-737378/)

n179911 07-03-2009 01:10 AM

How to configure Xterm colors if my xterm can support 256 colors
 
Hi,

I have a xterm which can have 256 colors.

How can I configure the prompt colors and ls output colors to take advantages of the 256 color values?

Thank you.

centosboy 07-03-2009 04:13 AM

Quote:

Originally Posted by n179911 (Post 3595147)
Hi,

I have a xterm which can have 256 colors.

How can I configure the prompt colors and ls output colors to take advantages of the 256 color values?

Thank you.


Code:

dircolors
or

set

Code:

$LS_COLORS
prompt colours are something else. you need to set the shell prompt for that. an example being a bash shell prompt.
mine looks like

Code:

# custom prompt
export PS1='\[\e[0;31m\]\u@\h/\[\e[1;36m\]\w\[\e[1;31m\]\$\[\e[0m\] '

which is set in my .bash_profile



list of colours for shell prompt

Code:

List of Color code
Color        Code
Black        0;30
Blue        0;34
Green        0;32
Cyan        0;36
Red        0;31
Purple        0;35
Brown        0;33
Blue        0;34
Green        0;32
Cyan        0;36
Red        0;31
Purple        0;35
Brown        0;33


n179911 07-03-2009 10:25 AM

Thanks. But the LS_COLORS only shows 16 colors, how can I use 256 colors?

And how can i use dircolors? when I do that at my command prompt, it said 'command not found'

Quote:

Originally Posted by centosboy (Post 3595304)
Code:

dircolors
or

set

Code:

$LS_COLORS
prompt colours are something else. you need to set the shell prompt for that. an example being a bash shell prompt.
mine looks like

Code:

# custom prompt
export PS1='\[\e[0;31m\]\u@\h/\[\e[1;36m\]\w\[\e[1;31m\]\$\[\e[0m\] '

which is set in my .bash_profile



list of colours for shell prompt

Code:

List of Color code
Color        Code
Black        0;30
Blue        0;34
Green        0;32
Cyan        0;36
Red        0;31
Purple        0;35
Brown        0;33
Blue        0;34
Green        0;32
Cyan        0;36
Red        0;31
Purple        0;35
Brown        0;33



n179911 07-06-2009 01:28 AM

I am looking for a way to configure my PROMPT and ls output using the 256 colors capability of the xterm-256.

Any help is appreciated.

centosboy 07-06-2009 02:28 AM

Quote:

Originally Posted by n179911 (Post 3598045)
I am looking for a way to configure my PROMPT and ls output using the 256 colors capability of the xterm-256.

Any help is appreciated.

Hey....i just posted how to configure your prompt????
Didnt i??


Code:

[root@server ]# rpm -qf `which dircolors`
coreutils-5.2.1-31.2

dircolors belongs to the coreutils software package. install this.


a good link for customising bash prompt with colours etc

Code:

www.understudy.net/custom.html#bourne


All times are GMT -5. The time now is 02:29 AM.