Bzr on windows: setting editor

John Arbash Meinel john at arbash-meinel.com
Thu Nov 2 21:53:07 GMT 2006


Andrew Nguyen wrote:
> I have been using bzr on my linux machine and have started to experiment
> with it on my windows machine at work.  I'm having trouble specifying
> the editor to use.  I have the following in my bazaar.conf:
> 
> [DEFAULT]
> #editor=c:\\winnt\\gvim.bat
> editor=c:/winnt/gvim.bat
> 
> and get the following error:
> 
> bzr: ERROR: Could not start any editor.
> Please specify one with:
>  - $BZR_EDITOR
>  - editor=/some/path in C:/Documents and Settings/nguyena/Application
>  Data/bazaar/2.0/bazaar.conf
>  - $EDITOR
> 
> I also tried setting environment variables and that doesn't seem to help
> either.  I am new to using Python on windows machines...
> 
> Thanks,
> Andrew


There are a couple of things here. The short answer is that

editor = C:\WINNT\gvim.bat -f

Should work for you.

So should:

editor = c:/winnt/gvim.bat -f

The issues I know of are:

1) On my machine, if I don't supply '-f', then gvim will start a
different process rather than running having the .bat wait for input. I
don't know why we interpret this as not being able to start an editor.
From what I've seen, the editor starts, and on other platforms, that
would give us "commit canceled"

2) You can't use a path with spaces. So you can't use "C:\Program
Files\Vim\7.0\gvim.exe". This is because we split on whitespace to allow
you to specify arguments to pass to the command. We are discussing how
to accomodate the 2 different issues (how do we escape a space properly).

3) Double slashes are probably just confusing things.

4) I'm running on WinXP, which might be more lax about what sort of
paths it can start. I thought I did some testing and trying to spawn a
process using forward slashes and it failed. But I just tried it, and it
was working.

I think the reason it was failing is because we check the return code.
And if it is "127" (which is probably -1), then we assume the editor
didn't start. And I'm guessing gvim.bat returns exactly that.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061102/0f62281a/attachment.pgp 


More information about the bazaar mailing list