chore(claude-opus-4-6): Branch name in sidebar sometimes doesn't update correctly... (#199)

This commit is contained in:
Austin Wang 2026-02-20 14:31:13 -08:00 committed by GitHub
parent f3a4e4db43
commit 94d44fefd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 6 deletions

View file

@ -88,9 +88,16 @@ _cmux_prompt_command() {
# Git branch/dirty can change without a directory change (e.g. `git checkout`),
# so update on every prompt (still async + de-duped by the running-job check).
# When pwd changes (cd into a different repo), kill the old probe and start fresh
# so the sidebar picks up the new branch immediately.
if [[ -n "$_CMUX_GIT_JOB_PID" ]] && kill -0 "$_CMUX_GIT_JOB_PID" 2>/dev/null; then
:
else
if [[ "$pwd" != "$_CMUX_GIT_LAST_PWD" ]]; then
kill "$_CMUX_GIT_JOB_PID" >/dev/null 2>&1 || true
_CMUX_GIT_JOB_PID=""
fi
fi
if [[ -z "$_CMUX_GIT_JOB_PID" ]] || ! kill -0 "$_CMUX_GIT_JOB_PID" 2>/dev/null; then
_CMUX_GIT_LAST_PWD="$pwd"
_CMUX_GIT_LAST_RUN=$now
{