Re: using gvim as editor on Windows
From: Tait <hidden>
Date: 2016-06-15 22:48:24
First of all: do you have the problems in cmd.exe or Git Bash or both?
cmd.exe I've never used git bash until now, but the behavior is the same there.
quoted
Does calling the .exe directly work for you? If I call gvim.exe directly (with or without -f -- it doesn't matter), it opens a new file called $@.I don't know where the $@ should come from.
It comes from line 33 of editor.c, in launch_editor().
if (strcmp(editor, ":")) {
/* ... */
if (strcspn(editor, "$ \t'") != len) {
/* there are specials */
strbuf_addf(&arg0, "%s \"$@\"", editor);
args[i++] = "sh";
args[i++] = "-c";
args[i++] = arg0.buf;
}
args[i++] = editor;
args[i++] = path;
args[i] = NULL;
/* ... */
}
It looks like this was added to detect EDITOR=: but it also
manages to catch Windows paths. I'm not familiar with the EDITOR=:
convention. What is that supposed to indicate? Can we narrow the
detection to that specific case, or does a : anywhere in EDITOR need
to be handled this way?
Rebase doesn't use launch_editor, instead just calling the editor
directly. Coming up with a combination of quoting and escaping that
can pass both cases will be difficult or impossible.
It appears that e97c9a removed the code above from editor.c, but
it's still present in prepare_shell_cmd() with even more legal
filename characters like = and ;.
Thanks for the help Markus.
Tait