bash prompt string problem

I am having the following problem with the bash prompt:
whenever $PS1 is configured to have a color to distinguish it from the typed and response text, e.g.

> PS1=’\e0;36m\w #\e \em ’

to make prompt the current path in cyan, the home, arrow, and end keys get all screwed up:
The home key cannot return the cursor to the first character in the input string, instead stopping at the tenth character.
The end key places the cursor 10 characters beyond the last character of the input string.
The arrow keys are similarly fubar

When the prompt string is the minimal

> PS1=’\w # ’

there is no such problem

I’m on KDE 4.10.2
I don’t remember having this problem ever before with bash

Anyone have any ideas why this is happening or is this a bug ?

PS1=‘prompt_code’; why not use “prompt_code”?

\e[0;36m = Bold Cyan

\w # = $HOME as ~ and a #, where “~ #” means you are at home folder.

You then embed unseen characters?

\e[ and \e[m

But what are you trying to use again? You do not set PS2 to anything?

For anyone that wonders what is going on here, have a look at this link: How to: Change / Setup bash custom prompt (PS1)

Thank You,

Apart from James’ remarks, I think your problem description is far from complete. You are adding “escape sequencies” to your prompt in the assumption that something will understand and interprete these escape sequencies. That “something” must be a terminal (or terminal emulator). But you do not even tell which terminal (emulator) and consequently we can not check it’s documentation to see what your combinations should do.