Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently changed my .bashrc and tweaked how my PS1 looks, but now it has a very weird problem. Before the end of the line in terminal (about 2 3rds of the way in) it jumps back to the begining of the line like so:

e before itarcath@Highgate][~/.gconf/apps/gedit-2/preferences] how long can a command b 

My first thought was that it wasn't getting the terminal size properly but tput cols returns the correct value.


share|improve this question

1 Answer 1

up vote 1 down vote accepted

I needed \[ and \] around the variables for colours, this commit shows my fix:

share|improve this answer
The readline library also accepts SOH (\x01) and STX (\x02) control characters -- useful in other programs (such as Python) which have customizable prompts but not \[. –  grawity Jun 2 '10 at 20:09

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.