\[\e]0;\u@\h: \w\a\]
in your prompt is to configure your xterm(?)'s title bar. Even though ANSI colorization is supported by ansi-term
, the escape sequences that manipulate title bar are not. That is why you see the prompt repeated twice - the first section is supposed to go to the title bar.
So either remove the first sequence from your PS1 or do something similar to what is suggested in Bash Prompt HOWTO:
function proml
{
case $TERM in
xterm*)
local TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
local TITLEBAR=''
;;
esac
PS1="${TITLEBAR}\
[\$(date +%H%M)]\
[\u@\h:\w]\
\$ "
PS2='> '
PS4='+ '
}
You can test specifically if you are in ansi-term
, the TERM
will be equal to eterm-color
.