From 9588b3fe495d6ed97a302c02a4f9abbf7e1129e3 Mon Sep 17 00:00:00 2001 From: David Vallner Date: Fri, 30 Sep 2022 17:03:48 +0200 Subject: [PATCH] Support using Windows git under WSL Linux Git is unusably slow when accessing repos in the Windows filesystem when using WSL; using Windows Git fixes this issue but it breaks the prompt since Windows Git returns Windows paths. This converts the path to the equivalent POSIX path which restores the prompt under this setup; it should just return the original path when passed a POSIX path, and do nothing on non-WSL systems. --- functions/fish_prompt.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 898046e..d0b46e6 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -157,6 +157,8 @@ function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git p [ -z "$git_toplevel" ] and return + + command -q wslpath; and set -l git_toplevel (command wslpath $git_toplevel) # If there are no symlinks, just use git toplevel switch $real_pwd/