LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2011, 02:45 PM   #1
musendrophilus
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Rep: Reputation: 0
bash weirdness


I recently added a line to my ~/.bashrc profile

export PS1='\e[1;32m[\u@\h: \W \t]\$ \e[m'

It works! Except if I end up typing out something that's longer and would normally break onto a second line, the text just overwrites the current line. See image for an example.

http://i.imgur.com/JAvVe.png

How can I fix this so it doesn't wrap back on the same line?
 
Old 06-17-2011, 02:54 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Have a look at this thread:
http://askubuntu.com/questions/24358...-the-next-line
 
Old 06-17-2011, 03:44 PM   #3
musendrophilus
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks, I looked at that and believed that I got it right with:

export PS1='\[\e[1;32m\][\u@\h: \W \t]\$ \[\e[m\]'

Except it still doesn't correctly wrap in the terminal.
 
Old 06-17-2011, 03:50 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
AFAIK, it's "\e[0m", not "\e[m".
 
1 members found this post helpful.
Old 06-17-2011, 06:29 PM   #5
musendrophilus
LQ Newbie
 
Registered: Oct 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Yep, that fixed it! Thanks to both of you!
 
  


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
More bash weirdness, variable is not being set MrUmunhum Linux - General 3 02-08-2010 04:01 PM
samba weirdness ryan462 Linux - Networking 0 05-17-2007 10:11 PM
hwclock weirdness Peter Aleksic Linux - Software 2 12-13-2005 02:06 PM
HDPARM weirdness..... MitchM99 Linux - Hardware 14 01-01-2004 07:13 PM
Bash weirdness guygriffiths Linux - Software 1 10-01-2003 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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