Skip to content

Git panel shows stale status after switching back from terminal or sleep/wake #48703

@lex00

Description

@lex00

Summary

If you switch to a terminal and run git commands (checkout, rebase, reset, stash pop) then switch back to Zed, the git panel can show stale branch and file status. Same thing happens after laptop sleep/wake.

Root cause

Git state only refreshes when Zed detects changes inside .git/ via filesystem events. If those events are lost (sleep/wake, heavy IO, OS event coalescing), the stale state persists indefinitely. There's no rescan on window activation and no manual refresh.

Steps to reproduce

  1. Open a project in Zed with the git panel visible
  2. Switch to a terminal and run git checkout -b new-branch or modify/stage files
  3. Switch back to Zed
  4. Git panel may still show the old branch or old file status

Most reliably triggered after laptop sleep/wake, where FSEvents are known to get dropped.

Related to #38109, #13176.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:integrations/gitGit integration feedbackfrequency:commonBugs that happen for at least a third of the users across all platforms and kinds of usagepriority:P2Average run-of-the-mill bugs

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions