Skip to content

Git branch in footer stays stale in WSL for repos under /mnt/c #5052

@psoukie

Description

@psoukie

What happened?

When running Pi in WSL with a repository stored on a Windows-backed path such as /mnt/c/..., the footer branch label remains stuck on an old branch after switching branches. Git reports the correct branch via git branch --show-current and git status.

I have a branch with a narrowly-scoped fix ready and would be happy to open a PR if a maintainer says lgtm.

The fix I tested keeps the existing watcher behavior but adds a narrowly scoped watchFile() polling fallback for .git/HEAD only if Pi is running in WSL and the repo root is under /mnt/<drive>/...

Steps to reproduce

  1. Run Pi in WSL from a /mnt/c/... repo.
  2. Switch branches, for example:

!git switch some-branch
!git switch main

Expected behavior

The footer branch label should update to match the current Git branch.

Version

0.75.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions