Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25th February 2009, 02:44 AM
Scott_fakename Offline
Registered User
 
Join Date: Feb 2008
Posts: 23
Strage behaviour after colorizing PS1

I recently decided to start playing around with colorized PS1. It colorized all right. The problem is, it started doing extremely odd things. When I set my PS1 to:

PS1="\e[34m[\u@\h \W]\$\e[m "

(Turns it purple)

It starts to wrap the line early, by about ten columns, and instead of wrapping it onto the next line, it's just going back to the beginning of the same line as it's on as though I had typed "echo -e \r", but I didn't. The same thing happens when PS1 is

PS1="\e[0;34m[\u@\h \W]\$\e[m "

or

PS1="$(tput setaf 5)[\u@\h \W]\$(tput setaf 0) "

(Though note, the tput one just turns it black in the end so the virtual terminals don't work that way.)

I tried all three, and they all make the prompt purple, but they all make the thing rotate back to the beginning of the current line, so that if I keep typing it overwrites the prompt. Then, if I hit backspace a bunch of times, it starts erasing the PREVIOUS line.

Any ideas what's happening?

--Scott
Reply With Quote
  #2  
Old 25th February 2009, 03:34 AM
scottro's Avatar
scottro Offline
Retired Community Manager -- Banned from Texas by popular demand.
 
Join Date: Sep 2007
Location: NYC
Posts: 8,142
Hrrm, I've always done it somewhat differently. Not familiar with that way of doing it.
Mine looks something like

PS1="\[\033[1;34m\]\u@\[\033[1;32m\]\h \[\033[1;36m\]\${PWD##*/} $ \[\033[0m\]"

(The 033 begins a color sequence. The 0m ends it.)
__________________
--
http://home.roadrunner.com/~computertaijutsu

Do NOT PM forum members with requests for technical support. Ask your questions on the forum.


"I don't know why there is the constant push to break any semblance of compatibility" --anon
Reply With Quote
  #3  
Old 25th February 2009, 05:34 AM
RupertPupkin's Avatar
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 4,619
Quote:
Originally Posted by Scott_fakename View Post
When I set my PS1 to:

PS1="\e[34m[\u@\h \W]\$\e[m "

(Turns it purple)

It starts to wrap the line early, by about ten columns, and instead of wrapping it onto the next line, it's just going back to the beginning of the same line as it's on as though I had typed "echo -e \r", but I didn't.
Your syntax wasn't quite right. Do this:
Code:
PS1="\[\e[0;34m\][\u@\h \W]\$\[\e[m\] "
Reply With Quote
  #4  
Old 25th February 2009, 11:20 PM
Scott_fakename Offline
Registered User
 
Join Date: Feb 2008
Posts: 23
Aha. A simple mistake. Thank you, it works now.

Awesome.

--Scott
Reply With Quote
Reply

Tags
behaviour, colorizing, ps1, strage

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Colorizing SVG Backgrounds westand Using Fedora 3 3rd September 2008 06:42 PM
Strage behaviour of DNS Service honey bee Servers & Networking 2 30th September 2006 12:23 PM
Strage GDM problem mic Using Fedora 5 3rd June 2005 05:55 PM
Strage problem in vfat mounting..! lakshman Using Fedora 9 14th April 2005 06:38 AM
hang at loading usb-strage on shuttle SN85G4 dansonic Installation and Live Media 1 28th May 2004 01:19 PM


Current GMT-time: 15:56 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat