Monday, September 30, 2013

Text overlapping in bash terminal

One time I had an issue with text overlapping in my bash terminal. When I printed a long line of text the letters began to be displayed from the beginning of the same line, not from the new line. The cause was some wrong character sequence in commmands that setup color in my PS1 variable. Example of correct color commands that do not cause the issue:

// excerpt from .bashrc
function set_prompt {
   local YELLOW="\[\033[0;33m\]"
   local GREEN="\[\033[0;32m\]"
   local ENDCOLOR="\[\033[00m\]"
   export PS1="$GREEN\u@\h $YELLOW\w> $ENDCOLOR"
}
set_prompt

No comments:

Post a Comment