HOWTO: Enable Console Line-Graphics in Cygwin rxvt

When I'm on a project that requires daily use of a Windows machine, I often install the Cygwin Tools so I can get access to an rxvt shell.  This in turn allows me to get OpenSSH access to my Internet Servers, in case I need to maintain something remotely.

Rxvt is a nice terminal emulator for the Windows Environment, but the default fonts don't have standard IBM Line Graphics defined.  This makes things appear rather unsightly when you do a make menuconfig to configure a Linux Kernel.  Through a bit of research through the archives, I came aross a Windows Font that does have the Line Graphics defined, and with some minor configuration, you can enjoy console sessions to your remote servers, and display proper line-graphics borders when the dialogs package is used to present text-based windows on your console.

I hope my notes and instructions are eloquent and thorough enough to guide you along a similar path.  And by the way, if you're in a strict Windows Environment that uses Microsoft Proxy Server to allow outgoing HTTP connections, you want to take a look at my SSH Tunnel Creator.  The SSH Tunnel Creator allows you to initiate SSH sessions through a MIcrosoft Proxy Server.

Quick Summary

  • Find, download, and install a copy of luconp.ttf (Lucida Console-P)
  • Create a new Desktop Icon for rxvt with this as the command-line:
 C:\cygwin\bin\rxvt.exe -sr -sl 9999 -fn "Lucida ConsoleP-12" -tn cygwin -bg black -fg grey -g 120x50 -e bash --login -i 
  • (Optional) Repair some color-ls brain-damage in some older Linux Distributions 

Finding and Installing The LuconP Font

 

The easiest "original source" place that I've found to get this font is the Bashish Project on SourceForge. The file you want within that tarball is:

 /bashish-1.9.24/bashish-root/bt/default/luconP.ttf.gz

For convenience, I have a mirror of the decompressed font file here.Once you have the luconP.ttf file on your Windows box, open up Control Panel > Fonts, then either do a File > Install New Font, or just drag the new font file into the list of fonts in the Font Control Panel. This will install the font in Windows.

Creating a new Desktop Icon

I usually just copy the rxvt icon in the Start > Programs > Cygwin group, as it's usually created by the Cygwin Installer. From there, right-click the icon, select Properties, and replace the "Target" contents with the command-line above. Save and enjoy.
 

Getting Directory Colors (DIR_COLORS) to work under Fedora Core 4

Fedora Core 4 is shipped with an /etc/DIR_COLORS file that is not configured for the "cygwin" terminal type. To get it working, go to /etc, and copy the existing DIR_COLORS file to DIR_COLORS.cygwin.  When you log into the machine with the cygwin terminal type, you will be using this new file:

 cp -apf /etc/DIR_COLORS /etc/DIR_COLORS.cygwin 

Alternatively, you can copy /etc/DIR_COLORS.xterm for a more subtle set of colors.  (the defaults in DIR_COLORS has brighter font colors).

Now, using a text editor like nano or gedit, you need to add a line to /etc/DIR_COLORS.cygwin to declare your new cygwin terminal type. Find the line that says this:

 # Below, there should be one TERM entry for each termtype that is colorizable 

Immediately below that line (or below all the other TERM entries in the file), add your cygwin terminal type declaration:

TERM cygwin 

Save and enjoy. Logout, and try your new Cygwin rxvt desktop icon.  Your Cygwin rxvt terminal should be working, and you should have Line Graphics around the borders generated by the dialogs package.  This is often seen when you do a make menuconfig to compile the Linux Kernel.