Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I installed Ubuntu 11.10 mini + LXDE and wanted to make my command line different in terminal (than just plain white), so I added blue color to path line (everything until $ sign) and it works fine but I have two strange glitches now:

  1. When i write a line which is longer than terminal window, instead of starting at next line it starts at the same one, overwriting everything which was in there.
  2. Sometimes while navigating over previous commands (up/down arrow keys) some part of command gets stuck and is treated as part of prompt (the blue text), but it is white and is non-deletable and is not taken as part of command when i press enter.

What could I mess up? The bad thing is that I don't remember what exactly did I change, but i'm sure I changed only one line in bashrc

Edit: for anyone who is willing to customize terminal line, here's a nice tutorial ->link<- . Make sure you don't miss any symbols (especially '\' ones) and everything works fine.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

The default bashrc can be found in /etc/skel/.bashrc. I would suggest you make a backup of your current bashrc, then replace your bashrc with the one in skel, then see if the problems still occur. Then if they don't, backup and edit your new bashrc, putting comments in saying what you did!!

share|improve this answer
Thanks a lot. This was mine small mistake with all those symbols, i've missed some. Now thanks to /skel file and a guide at ArchWiki I managed to fix this. Thanks again – foxy Nov 21 '11 at 10:19

I'm very late, but the problem here is that Bash doesn't know where to place the cursor, because it interprets the special colour code characters as normal text. This is fixed by putting [ and ] tags around the colour codes. Instead of writing \e[1;31m to make text red, you should write \[\e[1;31m\].

If you're having this problem, carefully check all colour escape codes to see if they have those tags around them.

share|improve this answer

I had the same symptoms, but in my case the problem was the ASCII bell escape sequence \a in my Bash prompt which leaded to the problem. The color codes were correctly enclosed by brackets (thanks @ringstaart).

My problematic Bash prompt setting in .bashrc was (omitting the color variable definitions):

PS1="\[$BLUE\]\u@\h: \[$YELLOW\]\w\a\\[$PURPLE\]\[$WHITE\]\$ "

Simply removing the \a solved the problem:

PS1="\[$BLUE\]\u@\h: \[$YELLOW\]\w\\[$PURPLE\]\[$WHITE\]\$ "

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.