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've learned a neat trick in school to make your terminal prompt text look more pretty, eg.

export PS1="(\h) \u \w "   

gives me

(brendt-ubuntu) brendt ~ 

The issue happens when I try to color these things, some weird text overflow bug appears:

This is without colors

enter image description here

This is with colors

(export PS1="\e[1;34m(\h)\e[m \u \e[1;34m\w \e[m")  

enter image description here

Are there any fixes for this?

share|improve this question

I fixed it using proper color coding:

PS1="\[\033[01;34m\](\h)\[\033[00m\] \u \[\033[01;34m\]\w \[\033[00m\]"
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.