Open andreasWallner opened 7 months ago
From discord comment:
I solved my problem by giving vim.exe an option(
--literal
) to suppress wildcard expansion likeui.editor = [ "C:/Users/hymkor/scoop/apps/vim/current/gvim.exe" , "--literal" ]
.
Maybe this is the problem you faced? Not all Windows tools can process \\?
path.
https://doc.rust-lang.org/std/fs/fn.canonicalize.html
I tried this and it does not help.
What you posted (\\?
) does look like a UNC path (even though I've never seen it with a question mark before), which does not seem to be the issue here.
If you look at the path that vim is being called with it starts with /c/
in unix style (maybe due to being called in the git mingw shell), and then continues with ?C:workgit...
which seems to be a messed up version of the windows path C:/work/git...
To check if vim is the issue here, I changed my config to call echo:
ui.editor = ["echo", "--literal"]
Then calling jj describe
prints:
$ jj describe
--literal \?C:workgittest.jjrepoeditor-m5ehy4.jjdescription
Slightly different, but also messed up.
I don't know which version of echo
is used, and if cmd.exe
's echo
supports escape syntax, but looks like \
is translated somewhere. If echo
and vim
are installed as MSYS binaries, MSYS might be the root cause.
This is due to Git Bash (MSYS?). I've personally encountered this too when running commands like less
from a Git Bash installation from outside of it.
The issue with UNC paths in general is indeed an issue with some other programs - see #3986 - but specifically for this issue, I would personally recommend using a non-Git Bash shell / program for jj
usage.
Description
When calling
jj describe
on a windows machine from git bash it tries to use an invalid path containing a '?'. It seems to mix up windows/unix paths.Steps to Reproduce the Problem
/c/work/git/test
which corresponds toC:\work\git\test
)jj git init
jj config set --repo ui.editor vim
jj describe
Note that the path passed to vim is
/c/?C:workgittest.jjrepoeditor-IurIAZ.jjdescription
instead of the expected/c/work/git/test/.jj/repo/editor....jjdescription
. With the editor set tonotepad
everything works as expected.Expected Behavior
vim should be opened with the correct path, git bash seems to do some conversion so
/c/work/git/...
andC:\work\git\...
both work from the terminal - I don't know whether they work when using e.g.std::process::Command
.Actual Behavior
vim is called with a mixed unix/windows path with what seems like encoding issues.
Specifications