I'm using bash inside Jack Palevich's Android Terminal Emulator, run on an Android phone. The bash version is 4.2.20(1)-release, obtained from samveen on the XDA forum.

My prompt is:

export PS1='\[\e[01;32m\]\u@\h\[\e[01;34m\] \w \$\[\e[00m\] '

I think I have escaped all non-printing chars correctly with \[ and \] but the prompt writes over itself and the prompt becomes corrupt making a mess of terminal input.

mkdir - p test/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/
cd test/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/

It's definitely to do with the colors as

export PS1='\u@\h \w \$  '

gives me a working prompt. How can I fix it?


1 Answer 1


It might just be your $TERM environment variable, if it's not properly displayed in the program; also, check the bashrc file as well as abash_logoutfile and whether or not it get sourced/called (properly?).

Try this as well:

export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .