Github: Git config `ui = always` breaks diff pane

Created on 23 Jun 2017  Â·  6Comments  Â·  Source: atom/github

I just updated atom to 1.18.0 in osx and started looking at the github package. The staging pane works fine, but when clicking on one of the modified files nothing happens.
I just get this error on the console:

Uncaught (in promise) peg$SyntaxError {message: "Expected "* Unmerged path ", "diff ", "diff --cc ", or end of input but "\x1B" found.", expected: Array[4], found: "", location: Object, name: "SyntaxError"}

This is my atom version:
Atom : 1.18.0
Electron: 1.3.15
Chrome : 52.0.2743.82
Node : 6.5.0

I tried different repos and safe mode but the error always happens

bug uncaught-exception

Most helpful comment

I digged into the github package code base and found out that the input to the parser of what-the-diff is invalid, basically it is color coded (that's why it complained about "x1B" which is the Esc character, to escape [32m (color code)).
Most likely, in your ~/.gitconfig you have this:
[color]
ui = always

Just need to comment out that line, it goes to default value "auto". That means, achieving benefits of both worlds, color highlight for terminal output and non-color-coded for pipe output, i.e. for atom github

All 6 comments

I'm also seeing this.

I also hit same problem, even after clean uninstall and reinstall of atom. There is no community packages and I can reproduce when run:

  1. atom --safe
  2. NODE_ENV=production atom

I digged into the github package code base and found out that the input to the parser of what-the-diff is invalid, basically it is color coded (that's why it complained about "x1B" which is the Esc character, to escape [32m (color code)).
Most likely, in your ~/.gitconfig you have this:
[color]
ui = always

Just need to comment out that line, it goes to default value "auto". That means, achieving benefits of both worlds, color highlight for terminal output and non-color-coded for pipe output, i.e. for atom github

@conlad Ooh, good find. ✨

We already override a few config options for git commands we run. I'm guessing we could do the same for color.ui to fix this one then.

Commenting out ui = always worked for me. Thanks!

Ill add a Me too comment here @smashwilson since this seems to have fallen into some crack.

My git config has no such values mentioned above to be commented out or worked around, so it breaks randomly here more often than not.

~> atom -v

Atom    : 1.21.1  
Electron: 1.6.15  
Chrome  : 56.0.2924.87  
Node    : 7.4.0  

~> apm -v  

apm  1.18.5  
npm  3.10.10  
node 6.9.5 x64  
python 3.5.2  
git 2.14.2.windows.1  
visual studio

Windows 10.0.15063.502 Pro

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebastianroming picture sebastianroming  Â·  4Comments

smashwilson picture smashwilson  Â·  4Comments

danielbayley picture danielbayley  Â·  5Comments

yubaoquan picture yubaoquan  Â·  3Comments

ccavolt picture ccavolt  Â·  3Comments