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"

git cheatsheet

git commit
   -a # Commit all changes skipping the Staging Area
   -v # See in the editor also the 'git diff' output

git log
   -p, --patch              # Generate patch
   --pretty=format:"%h %s"