From c2c47dc964a257131b3df2a127c2631b4760f3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramon=20R=C3=BCttimann?= Date: Fri, 16 Jun 2023 09:40:21 +0200 Subject: [PATCH] Fix pwd calculation for git worktrees A refactor changed this block from a `set git_dir $PWD` to `set git_dir $real_pwd`, but as `real_pwd` is a "static" variable and not dynamically computed, this breaks within the `pushd` / `popd` flow. Instead of using `$real_pwd`, we need to compute the *current* directory by calling `__bobthefish_pwd` again. Fixes #249. --- functions/fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 4651743..1ec90fd 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -185,7 +185,7 @@ function __bobthefish_git_project_dir -S -a real_pwd -d 'Print the current git p or return pushd $git_dir - set git_dir $real_pwd + set git_dir (__bobthefish_pwd) popd switch $real_pwd/