Configuring xterm for UTF-8

The goal is to make the xterm command produce a UTF-8-capable xterm by default, using the efont fonts (with very extensive UTF-8 support, including East Asian characters). Control-RightMouseclick will produce the VT Fonts menu which lets you choose various non-default font sizes.

Let’s also make a white background with black text (by default, in Debian, it is the other way round) and a red cursor.

Actually, there is no special effort involved in making xterm understand UTF-8; modern versions of xterm will do this automatically when the locale is a UTF-8 one. It is just a matter of having the right fonts.

Getting the fonts

The easiest is to just install the Debian package xfonts-efont-unicode. There are also rpm versions of efont-unicode; for instance, SuSE has them. You could possibly also install the fonts ‘by hand’, after getting the fonts directly from the makers, the Electronic Font Open Laboratory in Japan.

Configuring xterm for one user

This you do by editing the user’s ~/.Xresources file. For fixing the colours and the cursor, put in the lines:

*VT100*foreground:  black
*VT100*background:  white
*VT100*cursorColor: red

To fix the fonts, add the lines:

xterm*VT100*font:  -efont-fixed-medium-r-*-*-16-*-*-*-*-*-iso10646-*
xterm*VT100*font2: -efont-fixed-medium-r-*-*-10-*-*-*-*-*-iso10646-*
xterm*VT100*font3: -efont-fixed-medium-r-*-*-12-*-*-*-*-*-iso10646-*
xterm*VT100*font4: -efont-fixed-medium-r-*-*-14-*-*-*-*-*-iso10646-*
xterm*VT100*font5: -efont-fixed-medium-r-*-*-16-*-*-*-*-*-iso10646-*
xterm*VT100*font6: -efont-fixed-medium-r-*-*-24-*-*-*-*-*-iso10646-*

That’s it! BTW, many other options in xterm can be set through ~/.Xresources (or system-wide, see below). See man xterm.

Configuring xterm system-wide

If you like, you could make xterm UTF-8 capable for all the users on your system. For this, you put the ‘colours and cursor’ lines above in /etc/X11/app-defaults/XTerm-color, and the ‘font’ lines in /etc/X11/app-defaults/XTerm. These system-wide files, however, might (perhaps) become overwritten when xterm is upgraded. For a single-user system, just modifying ~/.Xresources is best.

Simplue WordPress theme, Copyright © 2013 Simplue WordPress theme is licensed under the GPL.