1

I use Emacs a lot including for most terminal sessions. One of activities includes typing git commands inside a shell buffer.

I found a very interesting color puzzle. After downloading forked repository https://github.com/yaitskov/java-nio-tcp-proxy I encountered that new lines which should be green are blank. And only deleted lines are visible (in red color). It was a big surprise for me because I did it a lot of times with different repositories.

After trying different combinations there are facts:

git diff --color works well in other existing and new GIT repositories in Emacs shell, Emacs term, Emacs ansi-term and gnome-terminal.

git diff --color works well for any GIT repo in Emacs term, Emacs ansi-term and gnome-terminal.

Not all files in the repo have the bug. But most of them do (java files, pom.xml).

But green lines are visible for config.properties.

I aware that a shell buffer is not 100% terminal. But I'm thrilled by this instability.

Daniil Iaitskov
  • 205
  • 1
  • 8

1 Answers1

1

It seems to me that it only happens on files with DOS line endings. The carriage return at the end is apparently messing with the rendering of those lines in shell-mode.

phils
  • 48,657
  • 3
  • 76
  • 115