[darcs-users] Darcs, Cygwin/MSYS, and Ctrl-C

Simon Marlow simonmar at microsoft.com
Tue Dec 5 11:19:33 UTC 2006


Last week I decided to investigate why darcs never seems to catch Ctrl-C and 
clean up properly on Windows; it always seems to leave a lock file behind.  It 
turns out that this is a deep swamp, but I think I've explored enough of it now 
to describe what the problem is.

If you want the executive summary: I don't recommend running darcs in any of 
these shell environments on Windows:

   - MSYS rxvt shell
   - Cygwin bash shell with CYGWIN=tty
   - Cygwin xterm or rxvt
   - Emacs shell buffer

because darcs is not able to catch Ctrl-C and clean up in any of the above. 
Instead, run darcs from one of these:

   - Ordinary Windows CMD shell
   - Cygwin shell with CYGWIN=notty (or CYGWIN not set to anything)
   - Start->Run

The reason is that Ctrl-C handling on Windows is tied to a "console".  Only a 
process that is attached to a proper Windows console can receive Ctrl-C or 
Ctrl-Break events.  The various shell environments provided by Cygwin and MSYS 
mostly do not have a proper Windows console to attach the child processes to, 
with the exception of Cygwin when CYGWIN=notty.

Actually this isn't the end of the story, I'm trying to follow this up with the 
Cygwin folks.  But for now, the situation is as I described above, the 
non-console environments should be avoided if you want darcs to be able to clean 
up after Ctrl-C.

If someone could put this on the wiki somewhere (or suggest the right place for 
me to put it) that would be great.

Cheers,
	Simon





More information about the darcs-users mailing list