Using PuTTY with Linux
PuTTY is a free SSH client and terminal emulator commonly used on windows. More information on PuTTY can be found on the PuTTY Home Page.
PuTTY is perhaps the most common windows SSH client used for connecting to Linux servers. Unfortunately, PuTTY and Linux do not play well by default. On the surface everything seems OK but when you dig a little deeper, Unicode and color issues start to show up.
Some problems can be solved by correctly configuring PuTTY but most users are not aware of how to do this, nor may they want to if they frequently connect from different clients. A better solution is to solve these issues on the server.
The package available for download below solves two of the most common problems with PuTTY, UTF-8 Encoding and colors which are too dark. It does this by querying the terminal answerback string to see if the client is PuTTY and if so, actions are taken to solve these problems.
By default, PuTTY does not use the UTF-8 Unicode encoding. Most modern Linux distributions enable UTF-8 by default which means when you use PuTTY, many characters are not shown correctly. This is commonly seen when viewing man pages which make use of single quotes. This problem is easily solved on the server side by correctly setting the LANG environment variable to say that the terminal does not support UTF-8.
The problems with colors come from an assumption that a terminal which implements xterm will have a light colored background. The default for PuTTY is a dark background so when programs select which colors to use, the wrong ones are selected. The two major culprits seem to be ls and vim.
ls has mechanisms in place to select the correct colors. To solve this problem, the choice made by colorls is reversed if the client is PuTTY.
vim does not have any smarts built in for color selection but it does allow the colors to be easily swapped. An simple plugin looks at the color selection made by colorls and selects vim colors based on that.
This package was built to work with EL4 distributions (Red Hat Enterprise Linux 4 and CentOS-4). It may work with other distributions which implement similar profile scripts as EL4.