Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs 256 colors not working using PuTTY and screen

I'm having trouble getting 256 colors to work using emacs 23.1.1 connecting using PuTTY and screen. Server is running CentOS 5.6.

In my PuTTY config, my terminal-type string is set to xterm-256color. In my .screenrc I have term xterm-256color Once in screen tput colors gives me 256, echo $TERM gives me xterm-256color, but once I start emacs M-x list-colors-display only gives me 8 colors.

Not sure what the problem is.

Thanks.

like image 637
Justin Schell Avatar asked Apr 10 '12 17:04

Justin Schell


People also ask

Does PuTTY support 256 colors?

4.12. 2 'Allow terminal to use xterm 256-colour mode' This option is enabled by default. If it is disabled, PuTTY will ignore any control sequences sent by the server which use the extended 256-colour mode supported by recent versions of xterm .

How do I set 256 colors in Linux?

Setting TERM=xterm-256color by default For PuTTY, you can change what TERM name it sends under Settings → Connection → Data → “Terminal-type string”. Change it to xterm-256color , done!


1 Answers

I hit the same problem.

To fix this problem, just add this to ~/.bashrc (yes,I use bash)

# -----------
export TERM=xterm-256color
export TERMCAP=
# ------------

run screen and emacs in an screen window. it's ok now.

versions:

bash-4.2.45

emacs-24.3_10

Screen version 4.00.03 (FAU) 23-Oct-06

like image 129
pubby Avatar answered Sep 18 '22 01:09

pubby