Notes about open source software, computers, other stuff.

Fixing colours in git output after upgrading to Ubuntu 14.04

After upgrading my Ubuntu 13.10 installation to 14.04, I noticed that the output of several git commands (e.g. git diff and git log) didn’t show colours as they used to, but showed ESC[ ANSI codes instead.
A quick internet search lead to this post on unix.stackexchange.com where the LESS environment variable was ‘blamed’. Indeed, I have my LESS variable (re-) defined in my .bashrc and .zshrc files.

The solution was to add -R to the environment variable, which allows raw control characters to be displayed. I now have the environment variable defined as:

LESS='--quiet -X -F -R'

1 Comment

  1. Damien

    Thank you, I also had this issue after upgrading to 14.04.

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2020 Lennart's weblog

Theme by Anders NorenUp ↑