Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of ESC[ characters when using git diff on Mac OS X Mavericks?

Tags:

git

macos

Since I installed OS X Mavericks, the result of the command git diff is rendering ESC[xxx characters like this:

ESC[1mdiff --git a/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xml b/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m ESC[1mindex 3b65cf1..0ca5d7e 100644ESC[m ESC[1m--- a/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m ESC[1m+++ b/console/org.linkedin.glu.console-webapp/decorate-grails-methods-plugin/plugin.xmlESC[m ESC[36m@@ -15,14 +15,14 @@ESC[m ESC[mThe purpose of this plugin is to decorate various grails methods.ESC[m 

This used to render properly prior to installing Mavericks. I have no clue what is different so any help in troubleshooting would be much appreciated.

Note that the pager used is less since when I hit h I get the following:

             SUMMARY OF LESS COMMANDS  Commands marked with * may be preceded by a number, N. Notes in parentheses indicate the behavior if N is given. 
like image 583
yan Avatar asked Dec 06 '13 02:12

yan


1 Answers

Do you have a LESS environment variable set? You can check using:

env | grep LESS 

or:

echo $LESS 

If so, you want to make sure the R option is in there. That allows the ANSI escape sequences to pass through unscathed, and they'll be rendered as colors in the terminal.

Just for reference, I use this:

export LESS=eFRX 
like image 90
John Szakmeister Avatar answered Sep 20 '22 19:09

John Szakmeister