Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.