4

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?

6

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\] "
| 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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