LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-24-2004, 02:29 PM   #1
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
Talking Slight Bash Problem...! (Solved!)


here's my prompt (it can be in either .bashrc or /etc/profile):

Code:
PS1="\e[0;36mGet Slacked!\e[0;30m [\e[1;35m\u\e[0;30m#\e[0;37m\w\e[0;30m] \e[0;39m" 
export PS1
normally it looks like this:

Code:
Get Slacked! [perry#~]
however, if i type more than a certain number of characters it does this:

Code:
tc/profiled! [perry#~] gedit /e
now if i make my terminal window bigger, it goes away (for a minute) and comes back a little later when i type more characters.

so my question is, what am i suppose to do fix this, looks like a simple problem for a die hard unix/linux bash user....

any takers ?

thanks much

- perry

Last edited by perry; 07-24-2004 at 05:36 PM.
 
Old 07-24-2004, 03:25 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
my try

untested of course


PS1="\[\033[1;36m\] Get Slacked! \[\033[1;30m\] [ \[\033[1;35m\]\u\[\033[1;30m\] # \[\033[1;37m\]\w\[\033[1;30m\] ] \[\033[0m\]"
 
Old 07-24-2004, 05:25 PM   #3
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Original Poster
Rep: Reputation: 30
I think I got it!

thanks for your post - it's nice when someone takes the time to make a stab at it...

well, looking at it from the outside, if at first there isn't an answer on LQ.org then there is always Google

any how, i managed to find out that man console_codes was the place to go albeit i had to try just about everything....

and this seems to do it:

Code:
 PS1="\e[0;36m\e[2KGet Slacked!\e[0;30m [\e[1;35m\u\e[0;30m#\e[0;37m\w\e[0;30m] \e[0;39m\e7\e[3l\e8"
try it out for yourself, it makes life interesting!

it's nice to the old ansi tricks we used to do in the world of dos still hanging around, this particular prompt will give you a colorful cursor different than the text colour as you type!

- perry

Last edited by perry; 07-24-2004 at 05:30 PM.
 
Old 07-25-2004, 01:40 AM   #4
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
man bash itself seems to indicate that \[ and \] should be in pairs. To that extent, foo_bar_foo 's solution seems more generic and you might find that it is more prdectable in longer prompts.

I thought that these "escape" sequences were terminal specific. Nice to know that they are generic. Thanks for man_console-codes.

End
 
  


Reply



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
Slight problem with Apache Basslord1124 Slackware 5 11-01-2005 02:30 AM
Just a slight problem. Pendu Debian 6 09-10-2005 06:22 PM
Slight swaret problem revenant Slackware 6 04-06-2004 02:16 PM
Slight problem with my TV-Out traku Linux - Newbie 0 10-27-2003 07:25 PM
Hello, and a slight problem with WINE linux-addict Linux - Software 19 06-11-2003 12:42 PM

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

All times are GMT -5. The time now is 07:50 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