You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to Fish 4.0.0, the acidhub prompt (set via fish_config prompt choose acidhub) displays a long, concatenated list of all Git branches in my repo instead of just the current branch. This worked correctly in Fish 3.7.1, showing only the current branch (e.g., (git:main)). Now it's unusable due to length and clutter.
Steps to Reproduce
Install Fish 4.0.0 (e.g., via Homebrew: brew install fish).
Set prompt: fish_config prompt choose acidhub (add to ~/.config/fish/config.fish).
Enter a Git repo with multiple branches (e.g., git init; git branch feature1; git branch feature2).
Check prompt in an interactive session.
Expected Behavior
Prompt shows only the current branch, e.g.:
(user-/path/to/repo(git:main)) >
git rev-parse --abbrev-ref HEAD correctly outputs the current branch (e.g., sentry/1-failed-import/vite-preloadError).
Standalone fish_git_prompt works fine: (sentry/1-failed-import/vite-preloadError).
Overriding fish_git_prompt doesn’t fix the full acidhub prompt, suggesting acidhub bypasses it or uses a broken Git query post-4.0.0 rewrite (Rewrite it in Rust #9512).
Repo has many branches (30+), which might amplify the issue.
Workaround
Using a custom fish_prompt with git rev-parse --abbrev-ref HEAD resolves it, but loses acidhub’s styling:
function fish_prompt
set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)
echo -n "❰$USER❙"(prompt_pwd)"($branch)❱✔≻ "
end
Suspected Cause
Likely a regression from the C++-to-Rust rewrite (#9512) affecting how acidhub parses Git data, possibly via a changed default in __fish_git_prompt_* vars or direct Git calls.
Thanks for looking into this!
PS Full workaround
# Colored prompt with optional git: prefix
function fish_prompt
set -l last_status $status
# Use $PWD for full path, replace $HOME with ~ for brevity
set -l pwd (string replace -r "^$HOME" '~' $PWD)
set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)
# Username in cyan
echo -n (set_color cyan)"❰$USER"
# Separator in white
echo -n (set_color white)"❙"
# Path in yellow
echo -n (set_color yellow)"$pwd"
# Git branch in green, with or without "git:" prefix
if test -n "$branch"
echo -n (set_color green)"("
# Uncomment the next line if you want "git:" back
# echo -n "git:"
echo -n "$branch)"
end
# Status symbol: green ✔ for success, red ✘ for failure
if test $last_status -eq 0
echo -n (set_color green)"❱✔≻ "
else
echo -n (set_color red)"❱✘≻ "
end
# Reset color
set_color normal
end
Description
After upgrading to Fish 4.0.0, the
acidhubprompt (set viafish_config prompt choose acidhub) displays a long, concatenated list of all Git branches in my repo instead of just the current branch. This worked correctly in Fish 3.7.1, showing only the current branch (e.g., (git:main)). Now it's unusable due to length and clutter.Steps to Reproduce
brew install fish).fish_config prompt choose acidhub(add to ~/.config/fish/config.fish).git init; git branch feature1; git branch feature2).Expected Behavior
Prompt shows only the current branch, e.g.:
(user-/path/to/repo(git:main)) >
Actual Behavior
Prompt shows all branches concatenated, e.g.:
(anthonyholland-/IdeaProjects/cyb/dev/gal-web-sk-area/gal-web-v2(git:chore/ncu-fix feature1 feature2 ... sentry/1-failed-import/vite-preloadError)) >
Environment
fish --version)git --version, e.g., 2.39.2]Additional Info
git rev-parse --abbrev-ref HEADcorrectly outputs the current branch (e.g.,sentry/1-failed-import/vite-preloadError).fish_git_promptworks fine:(sentry/1-failed-import/vite-preloadError).fish_git_promptdoesn’t fix the fullacidhubprompt, suggestingacidhubbypasses it or uses a broken Git query post-4.0.0 rewrite (Rewrite it in Rust #9512).Workaround
Using a custom
fish_promptwithgit rev-parse --abbrev-ref HEADresolves it, but losesacidhub’s styling:Suspected Cause
Likely a regression from the C++-to-Rust rewrite (#9512) affecting how
acidhubparses Git data, possibly via a changed default in__fish_git_prompt_*vars or direct Git calls.Thanks for looking into this!
PS Full workaround