This question already has an answer here:

After I made some changes, on Debian 9, to my prompt, it start behave.. strange. Like you see bellow, it start wrapping after command overflow certain length.

enter image description here I wanna keep it simple, so only thing I test against, while setting the prompt, in my .bashrc is the user and some special variables from text editors:

if [ "$USER" != root ]; then    # Set prompt for regular users
    PS1="${Gre}▒${Bla}${On_Cya}[\w]${RCol}$ "
else                            # Set prompt for root
    PS1="${Red}▒${Bla}${On_Cya}[\w]${RCol}$ "
fi

case $INSIDE_EMACS in           # Set prompt for emacs client
    *comint*) PS1="[\W]$ "
              ;;
esac

${Gre}, ${Bla}, ${Red}, ${On_Cya} and $RCol, are defined simply like this:

Gre='\e[0;32m';
Bla='\e[0;30m';
Red='\e[0;31m';
On_Cya='\e[46m';
RCol='\e[0m'    # Color Reset

marked as duplicate by Stephen Kitt, Kusalananda bash Mar 22 at 10:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.