XTerm configuration

About

You will find XTerm installed on your system in the most cases if you have installed X11. Here are some tricks to configure XTerm.

Design

If you want to make the XTerm background black, you have to create/edit your .Xdefaults file.

xterm*background:#000000
xterm*foreground:#FFFFFF
xterm*color0:#000000

And run this command, so that your .Xdefaults affects anything:

echo "xrdb -merge ~/.Xdefaults" >> ~/.bash_profile
xrdb -merge ~/.Xdefaults

If you like to have better colors for black backgrounds, use this:

xterm*background:        #000000
xterm*foreground:        #ffffff
 
!black
xterm*color0:         rgb:20/20/20
xterm*color8:         rgb:75/77/73
!red
xterm*color1:         rgb:cc/00/00
xterm*color9:         rgb:ef/29/29
!green
xterm*color2:         rgb:4e/9a/06
xterm*color10:        rgb:8a/e2/34
!brown/yellow
xterm*color3:         rgb:c4/a0/00
xterm*color11:        rgb:fc/e9/4f
!blue
xterm*color4:         rgb:34/65/a4
xterm*color12:        rgb:72/9f/cf
!magenta
xterm*color5:         rgb:75/50/7b
xterm*color13:        rgb:ad/7f/a8
!cyan
xterm*color6:         rgb:06/98/9a
xterm*color14:        rgb:34/e2/e2
!white
xterm*color7:         rgb:d3/d7/cf
xterm*color15:        rgb:ee/ee/ec

The Meta-Key (Alt)

At some systems the default configuration breaks some shortcuts. To fix that, edit /etc/X11/app-defaults/XTerm and add this line:

*metaSendsEscape: true

The Redraw issue with VIM

With newer versions of VIM the window is redrawn using different yellow-colors when the first key is pressed. Use this line to fix that:

XTerm*termName: xterm-256color
UXTerm*termName: xterm-256color

Tags: