# Colors in Putty



## zloy (Jun 15, 2010)

Hi there!
I apologise for my silly question, but I couldn't handle it by my own.

I use Putty to enter FreeBSD Box from my Windows XP. I use git in the Box ang I've configured it to output colored diffs. But rather seeing colored text, I see ESC sequences put on the screen which prepend white text on black x(. See the screenshot. How can I make that work?

I configured putty to set env TERM to putty, I also tried xterm-color, but with no luck.
Same time ls -G shows colored list (??)

Please direct me the right direction to dig in. 
Thanks in advance.


----------



## zloy (Jun 15, 2010)




----------



## zloy (Jun 15, 2010)

Also I notice that "git status" outputs colored text right way with no dependance to TERM env var, but "git show 5ac611b" outputs with some TERM values (term-color) ESC prepended texts where ESC words are inverted.

ps
how can I see TERM values supported by OS?


----------



## SirDice (Jun 15, 2010)

zloy said:
			
		

> how can I see TERM values supported by OS?


They are defined in /etc/termcap. See termcap(3).


----------



## zloy (Jun 25, 2010)

SirDice said:
			
		

> They are defined in /etc/termcap. See termcap(3).



Thanks, SirDice )
I found putty term in it.

Also I found that 
	
	



```
git show --color | tee null
```
 produces colored output while 
	
	



```
git show --color
```
 doesn't. Strange, isn't it?

Now I think that effect is related likely to git, than to Putty or FreeBSD.


----------



## SirDice (Jun 25, 2010)

zloy said:
			
		

> Now I think that effect is related likely to git, than to Putty or FreeBSD.


I think you may be right.

I don't use git but I regularly use cvs. This is what I use to compare diffs:


```
cvs diff -r 1.11 -r 1.12 somecode.pl | vim -Rf -
```

Vim will make everything nicely color coded :e


----------



## zloy (Jun 28, 2010)

SirDice said:
			
		

> I don't use git but I regularly use cvs. This is what I use to compare diffs:
> 
> ```
> cvs diff -r 1.11 -r 1.12 somecode.pl | vim -Rf -
> ```



Thanks SirDice :e Good luck!


----------



## pbostley (Jun 21, 2012)

*The problem is like LESS*

Add -R to your LESS environment variable.  The less pager will strip some escape codes by default.  

Mine is 


```
LESS=-MMCR
```

-p.j.


----------

