LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-03-2009, 02:10 AM   #1
n179911
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 0
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.
 
Old 07-03-2009, 05:13 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by n179911 View Post
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
 
Old 07-03-2009, 11:25 AM   #3
n179911
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Original Poster
Rep: Reputation: 0
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 View Post
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
 
Old 07-06-2009, 02:28 AM   #4
n179911
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 07-06-2009, 03:28 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by n179911 View Post
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

Last edited by centosboy; 07-06-2009 at 03:33 AM.
 
  


Reply

Tags
xterm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XTerm Colors ewolf Linux - Software 1 10-16-2008 12:03 AM
xterm Colors AlphaSigmaOne Slackware 21 09-29-2008 08:31 AM
gnu screen won't do 256 colors with xterm, rxvt, mrxvt slackware-elf Linux - Software 2 09-12-2007 11:47 PM
rxvt/xterm colors macondo Debian 2 04-20-2004 08:10 PM
ls colors in xterm/rxvt/aterm Pougan Linux - Software 8 12-01-2003 12:24 PM


All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration