Weird behavior with Bash

1

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.

My.bashrc: http://github.com/Arcath/.Files/blob/master/dotfiles/.bashrc

Arcath

Posted 2010-06-02T06:14:00.150

Reputation: 469

Answers

1

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

http://github.com/Arcath/.Files/commit/26527f678073e1b52449326521e98ebc8f3e47ac

Arcath

Posted 2010-06-02T06:14:00.150

Reputation: 469

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 \[. – user1686 – 2010-06-02T20:09:06.127