If you see the bell on the title, it means when I deleting string it was reaching $ sign and give a bell warns. But the strange thing is my cursor is not completely clear the string, it is still leaving my URL left over there. I already checked PS1 on my bash profile and it looks like this
export PS1='\e[1;32m\W \t \e[1;31m\u \e[1;32m$ \e[0m'
But when I resize the window of the terminal, suddenly it turns back normal.
Best Answer
You need to enclose the non-printable characters properly in
\[...\]
block. This ensures that correct number of characters are counted while generating the prompt.I had the same problem and here's the PS1 that gave no issues so far :
That is my understanding of what I read on SO:
https://stackoverflow.com/q/5947742/28938235#28938235
https://stackoverflow.com/q/17432993/
https://stackoverflow.com/q/20697195/20698168#20698168