Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I followed some articles on how to change the prompt, I've got the result I was looking for, but when the cursor reach the end of the screen it doesn't go new line and tab completion it's strange.

# ~/.bashrc

# colorful, with time, history id and path (also in window title)
export PS1="\[\e]0;\w\a\]\e[1;36m\t-\! - \w>\e[m "

Anybody have got a clue on what am I doing wrong?

share|improve this question
up vote 6 down vote accepted

The colour setting escape sequences need to be enclosed in \[ and \] in order to tell bash readline that they don't contribute to the length of the line. This should do it:

PS1="\[\e]0;\w\a\e[1;36m\]\t-\! - \w>\[\e[m\] "
share|improve this answer
Thank you @ak2, that seems to have solved the problem, a good relief... – ecoologic Jun 11 '11 at 20:24

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.