Wednesday, November 08, 2006

Cygwin terminal problem fixed

I have Cygwin ("a Linux-like environment for Windows") on two computers which both run Windows XP. If you want to use some Unix-based utilities with real shell scripts, but your employer won't let you install Linux on your computer, Cygwin is the way to go. Anyway, I have been annoyed for a couple of months with one of these installations.

On Cygwin on my laptop, I always got an error message, "WARNING: terminal is not fully functional" whenever I tried running the man command. On my other installation, I got nicely formatted and colored documentation, which paged nicely. I tried lots and lots of tweaks to get the Cygwin installation on my laptop to work properly, including reinstalling Cygwin, the groff program, and messing with .bashrc and everything else, but nothing fixed the problem.

Today I set both systems side-by-side and set out to conquer this gremlin. I ran "cygcheck -c -s -v" on each system, output the results to a disk file, and ran a diff on them. Many differences turned up, but nothing special jumped out at me. The cygcheck comparison, helpful as it was, did not give the solution.

Somehow I noticed that the home directory of my desktop computer (the one which worked) did not have a ".termcap" file, at all. The home directory on my laptop computer (the one that always gave that error message) did have a ".termcap" file.

"Hmmm . . .," I thought. "I wonder if that could be the problem." I renamed the ".termcap" file in my home directory to something else, restarted Cygwin, and instantly the problem disappeared. Now less and man work exactly the way they should. Problem solved!

I'm sure most people have no interest in this, but for me, it was a small victory worth saving to the web. Hope it helps somebody else who uses Cygwin.