I have a custom bash configuration that I install on many different machines, and this includes a custom $PS1, which is generated by a script, and ends up like this :
\[\e[0;33m\][\!] $(if [[ $? == 0 ]]; then echo "\[\e[0;32m\]✓"; else echo "\[\e[0;31m\]✗"; fi) \[\e[1;33m\]\u\[\e[1;36m\]@\h \[\e[1;32m\]\w \[\e[1;32m\]\$\[\e[00m\]
Which is a little bit ugly, but it appears that the problem is only caused by the ✓ and ✗ characters; infact, replacing them by o and n resolves the problem, and making
PS1='✓'
still suffers it.
The problem is that when I type a command long enough to reach the limit of my terminal, instead of continuing on the next line, it overlaps the prompt and the beginning of the command. The funny thing if that it only overlaps the first time, then it normally continues on the next line.
The machine on which this happens is a brand new Debian 8 Jessie Virtual Machine, made on a Debian 8 Hypervisor running Xen4.4, with the xl toolstack. I make several other identical VMs and had the same result. However, I don't have this problem on any physical Debian machine I tried (including my Dom0). I also tried on a Ubuntu15.04 VM, and it doesn't suffer the problem either.
I also noticed that this problem happens both on a ssh connexion and via the serial console.
Does anybody have any idea about what's happening ?