No git color schemes under rxvt/cygwin
Asked Answered
I

2

9

After getting tired of the default cygwin terminal, I decide to try rxvt. Everything seems fine except one thing: the color schemes for my git repositories stop working.

BTW other color schemes like the vim editor works fine under rxvt. I also ran this script to ensure that 256 colors are enabled.

My ~/.gitconfig looks something like this:

[user]
  name = xyz
  email = [email protected]    
[color]
  diff = auto
  status = auto
  branch = auto
[core]
  autocrlf = false
Interlanguage answered 15/11, 2010 at 15:31 Comment(7)
From the script you linked to: "doesn't work with rxvt and I don't know about other terms because it uses xterm color escapes..." and yet it worked?Gastrocnemius
Interesting, didn't notice that before. But that script did print out colors on my screen :)Interlanguage
Looking at the git source, I see explicit xterm character sequences for the colors, like \033[31m - my guess would be that those don't work in rxvt. The weird thing is that the script works. It looks like it's printing out essentially the same kinds of things, though they're 256 colors, not 16. Does rxvt somehow support 256 color xterm escape sequences, but not 16?Gastrocnemius
That could well be the case I guess.Interlanguage
Are you using Cygwin's git or a Windows git? Colours wouldn't work with the latter, as it would try to use Windows console APIs rather than escape sequences. Rxvt supports colour sequences just fine.Giacinta
Good point. I was using msysgit. I just tried cygwin git and it worked fine.Interlanguage
@gnfalex found a way to use msysgit and the colored output.Toothache
B
21

If change all settings in ~/.gitconfig color section from "auto" to "always", then MSYSGit coloring work even in rxvt/mintty

[color]
    ui = always
    status = always
    branch = always
    diff = always
    interactive = always
Blinders answered 15/5, 2013 at 14:56 Comment(3)
Impressive! Works flawlessly for me!Toothache
Also helped me in cygwin's git when I mysteriously lost colors everywhere after using GNU screen once.Gritty
Thank you so much. I was looking for this solution and now my Cygwin work perfectlyGenitals
I
8

Thanks to suggestion by ak2, I solved this problem by switching from msysgit to cygwin's git.

Interlanguage answered 16/11, 2010 at 15:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.