[darcs-devel] [issue1463] Investigate "proper" Windows APIs for launching editor.

Trent Buck bugs at darcs.net
Sun May 17 06:19:09 UTC 2009


New submission from Trent Buck <trentbuck at gmail.com>:

The current behaviour of darcs record --edit and darcs send --edit on
Windows is suboptimal.  Paraphrasing an (old) post to darcs-users from
Max Battcher:

Darcs starts an external editor process using a standard shell-style
invocation.  This is fine for a tty editor like vi or edit, but a GUI
editor will typically do one of two things:

  1. show a pop-up dialog: "this is a Win32 application" and exit.

  2. fork a new editor process in the background, then exit.

To know when the user is done editing, Darcs waits for the process it
launched to exit.  In case (2) this happens immediately, so Darcs
doesn't "see" the real editor process.

There are Win32 APIs for executing GUI apps and waiting for them.
Someone should investigate if an existing Haskell package provides a
suitable wrapper for them, and if it is worth using them in Darcs.

There is also a wrapper command for these APIs called "start", similar
to open(1) on OS X.  Perhaps the documentation should mention

  If setting %DARCS_EDITOR% to "foo" doesn't work, try setting it to
  "start /wait foo".

If Darcs created temporary files with the appropriate extension
(e.g. .txt), the "foo" part could be ommitted, and this approach could
be the default on Windows.  That would mean that users would get their
preferred editor (as defined by the .txt association in Explorer) out of
the box.

----------
messages: 7827
nosy: dmitry.kurochkin, kowey, simon, thorkilnaur, twb
status: unread
title: Investigate "proper" Windows APIs for launching editor.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1463>
__________________________________


More information about the darcs-devel mailing list