Replies: 6 comments 2 replies
-
I would like to support it, but since I don't use Windows I don't know to what extend we already do and what additional work would be involved. And maybe more importantly I have no way of trying it out. One major problem with Windows is that one can combine various components in our case mostly emacs and git, that were compiled using different libraries (native-windows/cygwin/mingw/wsl1/wsl2), and that they have multiple (conflicting) options to make them work "better" with one another. This is especially the case when it comes to different ways of representing the same path. It could be that what you want to do is already possible and that you are just "holding it wrong". Or maybe we have yet more path translation code to Magit. The problem with the latter is that there is a big risk that by supporting "paths as they appear with your setup" would break what is already working for other users and their respective setting. I recommend you start by finding other wsl users first (maybe on the Emacs reddit) and ask them for guidance. |
Beta Was this translation helpful? Give feedback.
-
Yeah, supporting multiple platforms and environments is a huge pain. I made a little wrapper that intercepts the query for the top level and translates the result with |
Beta Was this translation helpful? Give feedback.
-
It's an external script. I think treemacs also uses git. If I handle translation outside of emacs, then there's a chance it will work for other packages as well. It's quick fix, but it seems to work. #!/bin/bash
git_exe=/win/software/git/bin/git.exe
if [[ "$*" =~ rev-parse ]] && [[ "$*" =~ --show-toplevel ]]; then
/wsl/usr/bin/wslpath $("$git_exe" "$@")
else
"$git_exe" "$@"
fi |
Beta Was this translation helpful? Give feedback.
-
I'm quite interested in making this work and have gotten to a similar place as @goldfita. To clarify the "WSL support" title: if I use the Linux Unfortunately there are many issues when using |
Beta Was this translation helpful? Give feedback.
-
You may find wsl-path.el helpful. I ran into some problems with infinite recursion. When I replaced the emacs path translation with the wslpath utility, I was able to get it working. Even with |
Beta Was this translation helpful? Give feedback.
-
https://emacs.stackexchange.com/questions/82970/m-x-magit-status-extremely-slow-on-large-repository turned out to be related to WSL. Adding the link as a data point. |
Beta Was this translation helpful? Give feedback.
-
What do you think about WSL support? I've been able to get ripgrep and treemacs, which uses python on windows, working without much difficulty. The trouble with git is that it's being used to return a file path, specifically getting the root of the project using
magit-toplevel
. Somehow this ends up getting tacked onto the current path. I don't understand exactly what's happening, but the general issue is clear./wsl/home/share/eclipse.jdt.ls/org.eclipse.jdt.ls.core/src/org/eclipse/lsp4j/extended/C:/Development/eclipse.jdt.ls/
I tried using git from within WSL, but it was unusably slow. I could probably work around this problem, but there may be other windows paths that need to be translated. Translating paths is easy to do using wslpath, but it would need to be wrapped around every path coming back from git.
Beta Was this translation helpful? Give feedback.
All reactions