pureline icon indicating copy to clipboard operation
pureline copied to clipboard

Use git on Windows for Windows folder on WSL

Open letrunghieu opened this issue 2 years ago • 0 comments

Due to microsoft/WSL#4401, when we switch to a directory mounted from the Windows filesystem on WSL2, the git segment is very slow. For large repositories, this can hang the whole terminal.

This patch detects if we are in a WSL environment and if the current folder is mounted from the Windows filesystem. If those criteria are true, we use the git.exe binary in the git segment instead of the one installed in Linux.

There is a limitation to this approach. If we mount another filesystem under /mnt in WSL, the changes here also try to use git.exe.

letrunghieu avatar Jan 30 '23 10:01 letrunghieu