Archive for the 'Cygwin' Category

technicolor terminal : the Cygwin saga

Not too long ago I posted a snippet that explained how to enable the 256-color display capabilities of terminals that support it. I’ve since had a bit of trouble getting this to work in terminals under Cygwin. Applications like Vim understand the capabilities of such a terminal, but less and man would complain:

   WARNING: terminal is not fully functional

After bit of digging I finally realised that it isn’t enough to have entries for those terminal types in /usr/share/terminfo/*/*. Some apps expect to find the terminal capabilties described in a termcap file, either /etc/termcap or ~/.termcap. Fortunately, there is an easy way to export the capabilities described in the terminfo database entries to a termcap file:

   $ infocmp -C xterm-256color >> ~/.termcap

If you’re a screen user, its worth exporting the entry for screen-256color too. man infocmp for more information.

bash: clear: command not found

A base install of Cygwin does not include the clear command, though the same functionality can be achieved using ^L. The command is part of the ncurses package that may be found in the Libs category.
Thanks to Ruben Laguna for his post on the subject.

EDIT: This ncurses package now appears in the Utils category.

cygwin svn: cannot move ‘*/tmp/entries’ to ‘*/entries’: permission denied

It seems that Cygwin’s subversion port and Tortoise SVN do not play well together. A default installation of both can result in the following error occuring seemingly at random during long checkout or update operations:

Can't move '/cygdrive/c/xxx/trunk/.svn/tmp/entries'
to '/cygdrive/c/xxx/trunk/.svn/entries':
Permission denied

To resolve this, Tortoise SVN’s icon overlays may need to be disabled entirely as suggested here. While Tortoise SVN doesn’t have a Disable overlays checkbox, they may be effectly disabled as follows:

  • <SecondaryClickContextMenu> > Tortoise SVN > Settings > Icon Overlays
  • Ensure the checkout directory is included in the Exclude paths mask (I’ve taken to using c:* and c:*).

Others have suggested that it may not be necessary to disable Tortoise SVN’s overlays entirely, as long as the Show overlays only in explorer tickbox is ticked. This didn’t work for me; your kilometerage may vary.

SVK under Cygwin

SVK is a great source control and versioning solution. I particularly like the idea of having local access to an entire respository while still having the safety of an off-site upstream server.

As its written entirely in PERL, SVK is fairly portable (but there’s a "but" coming), but (ah, yes … there it is) while it works flawlessly on my Gentoo system, I’ve had problems getting it to work on Windows. Win32 binaries are available, but they rely on plink for svn+ssh, and I’ve not been able to get the combination to work. I elected instead to run the standard CPAN distribution of SVK under Cygwin. This, of course, brought its own set of problems.

I’ve posted a wiki article that outlines the steps that I followed to get SVK running under Cygwin.

a cygwin package cleaner

Cygwin is invaluable to any Windows developer used to (or even just familiar with) the tools that are available in a GNU/Linux development environment.

Probably the only complaint that I have is that the setup tool doesn’t take care of cleaning up old packages. While I don’t have all of the packages installed, I have enough of them that I don’t want to have to prune the packages by hand. Enter cygpkgclean; its a little PERL script that deletes all packages except the current and previous versions (of both binary and source packages). It doesn’t yet cater for packages that are no longer in the setup.ini or that have moved to a new directory.

I had hoped to implement this as nothing more than a bash script (so that it would run on the barest of cygwin installations), but that proved to be a little beyond my meager script-fu (for now!).