Matice, On Wednesday 11 May 2005 08:54, matice@nic.fi wrote:
hello i have tried to redo my bash prompt to my flavor as the following..
PS1="\e[34;1m\u\e[33;1m@\e[31;1m\h\e[33;1m: \e[32;40m\w \e[33;1m#\e[0m\]"
but for some reason after using the above format, when i attempt to review command history, often it over writes the output over hte current line, and sometimes as i type, the text all of a sudden jumps to the begining of the line and continues therem even thou it does that, it still does take in the command as it is fed, in some situations, this tends to be annoying, so i hope some one can tell me where i have miss structured the prompt format.
BASH doesn't know, because you haven't told it, which parts of your prompt move the cursor and which do not. Surround those portions of the prompt string that don't actually print something on the terminal's screen area with \[ (backslash followed by left-square-bracket) on the left and \] (backslash + right bracket) on the right. This is documented in the BASH manual page.
regards Matice
Randall Schulz