LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-02-2009, 07:53 PM   #1
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Rep: Reputation: 30
please help make my bash prompt color


well I am looking for green (one computer) and red the other. I followed to the best of my limited abilities to follow some internet instructions but I could not get it so the prompt allowed line wrapping of commands. I am using fedora 10 and centos 5.3. this is my prompt. I thought this would be easy but its not for me.

[\u@\h \W]\$

again I want the exact same prompt this creates but colored. thanks much.
 
Old 04-02-2009, 08:03 PM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
Did you add the entries to your home/username/.bashrc file?
 
Old 04-02-2009, 08:26 PM   #3
burninGpi
Member
 
Registered: Mar 2006
Location: Fort McMurray, Canada
Distribution: Gentoo ~amd64
Posts: 163

Rep: Reputation: 30
You need to put \[ and \] around the non-printing characters, for example:
Code:
\[\033[31m\][\u@\h \W]\$ \[\033[0m\]
for red, or:
Code:
\[\033[32m\][\u@\h \W]\$ \[\033[0m\]
for green.
 
Old 04-02-2009, 08:37 PM   #4
extendedping
Member
 
Registered: Feb 2004
Posts: 210

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by burninGpi View Post
You need to put \[ and \] around the non-printing characters, for example:
Code:
\[\033[31m\][\u@\h \W]\$ \[\033[0m\]
for red, or:
Code:
\[\033[32m\][\u@\h \W]\$ \[\033[0m\]
for green.
thank you the way I did it did not use the same format this works perfectly...
 
Old 04-02-2009, 09:47 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,688

Rep: Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658Reputation: 2658
on fedora gnome-terminal that can be done with the terminal gui , from
edit/current profile

and select the colors tab and set it there to custom or to use system default if that IS the system theme text color
i wrote my theme so i set the terminal text color there
 
  


Reply


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
Command Prompt Color init_linux Linux - General 2 09-08-2005 02:20 AM
help! bash command prompt font/color change richiangpan9 Linux - Newbie 3 04-24-2005 11:34 AM
make bash interactive and change prompt DropSig Linux - Newbie 3 05-17-2004 08:16 AM
escape sequence for changing color of prompt killer_bunny Linux - General 1 02-10-2004 07:40 PM
Prompt Color medamnit Linux - Newbie 4 05-06-2002 11:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:23 PM.

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
Open Source Consulting | Domain Registration