I get an trash after the prompt when I flick through the history when I add colors to my prompt.
I have tried the proposed color prompt command from the postgres doc:
\set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%]%# '
I have also tried a lot of other prompt examples that i found with google but with the same result.
So after setting the prompt I have a yellow prompt something like this:
ulf@mydb=#
I then run the query:
ulf@mydb=# select * from country;
Then I flick through the history with ↑</kbd>↑</kbd>↓</kbd>. This would bring me the select-line ones more, but instead I get:
ulf@mydb=# \set PROMPT1 'select * from country;
Note the \set...
before the select
which is a remnant from the initial promt-setting.
I also get similar result if I put the \set PROMPT1
-command in .pslqrc
I get the same result in both xterm and gnome-terminal. I have my bash-prompt colored in a similar way but I have no problems with that prompt.
What have I done wrong?