I've written custom prompts for several boxes but this one has an error I just can't identify and need a second set of eyes to help solve it.
I've set the following as my prompt:
PS1="\[\e[30;42m\]\u@\h\[\e[0m\]\[\e[30;47m\] \#\]\[\e[0m\]\[\e[32;1;40m\]\w>\[\e[0m\] "
(hostname/un obscured & image enlarged slightly to make it easier to read.)
Everything looks fine initially as you can see here:
1- It sets the username@host in back on green text.
2- It then changes to an off-white an prints the command number for the terminal.
3- Next, changes to a green on black font and prints the working directory.
4- Finally is prints a ">" character and a space.
The problem occurs when I try to "up arrow" to reuse and/or edit a prior command. It prints the prior command fine, but if I arrow over to edit the command
sometimes the first character can not be deleted from displaying as you can see in the following composite screen-shot
Here I did a simple ps and piped it through grep. After getting the output, I up-arrow to repeat the command. As you can see by the second section the cursor only goes back to the "s" in ps. The "p" can not be deleted. Hitting enter just displays a new line, so the "p" was just a ghost being displayed and not really there.
Can anyone else see why that randomly occurs? I must have a goof in the prompt, but I sure as heck can't see it.
Thanks in advance.