When I run magit-status through emacs (gui or command line) and show a diff for a file, the color codes don't get escaped properly. Therefore, the whole diff is filled with ^[['s and that makes it impossible to see what's going on.

Here's what I've tried:

  • If I run a regular git diff, in terminal colors are displayed correctly.

  • Problem occurs for both GUI and in terminal (-nw)

  • I have updated to magit-20140305.1300 from the elpa repo, through the emacs package manager.

  • I have tried with both different emacs themes, with no change.

  • I have tried tweaking the magit-item-highlighting, as suggested on a different bug here.

I am using bbatsov's prelude, but have updated magit, as stated above.

Any one know what could be causing this, and how I could fix it?

有帮助吗?

解决方案

Most likely you have set one of the git variables color.ui or color.diff to always, and should change that back to true so that you get coloured diffs when useful (in a shell) but not when not useful (pretty much everywhere else, including magit).

Or better yet unset the variable completely using e.g. git config --unset color.ui.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top