* Better placement of Fossil prompt info
Instead of blindly tacking `$fossil_prompt_info` onto the end of the
prompt string and making assumptions about whether `$PROMPT` or
`$RPROMPT` are in use here, assume the user is using a theme that puts
`$git_prompt_info` in there somewhere and inject our info immediately
afterward. The theme creator decided that's a good place for Git prompt
info, so that's a good place for Fossil prompt info, too.
This also replaces some calls out to `grep` with internal Zsh string
manipulation for less overhead.
* fix(fossil): fall back to RPROMPT when the theme has no git_prompt_info
Keeps today's behaviour for themes without git_prompt_info, and re-checks on
each prompt in case the theme rebuilds its prompt.
---------
Co-authored-by: Robby Russell <robby@planetargon.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
BREAKING CHANGE: the fossil plugin now ships a prompt function that
removes spacing between segments. Spaces can always be added by
changing the setting variables. Check out the README for details.
* Reduced unnecessary space in Fossil plugin prompt
The prior version was way too opinionated, adding space between each element of the prompt string, unlike common Git prompt strings. If the user wants more space, they can override our public variables to suit. The inverse argument doesn't hold: it's easy to add space to existing variables, but not as easy to remove it after the fact.
As part of this, changed the branch name from red to blue (matching the preceding part of the prompt) so the red "X" added to indicate a dirty branch doesn't get lost in the branch name.
* fix(fossil): keep the branch name red
* Document fossil prompt settings
---------
Co-authored-by: Robby Russell <robby@planetargon.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Marc Cornellà <marc@mcornella.com>
Using the automation-friendly "fossil branch current" feature added in
Fossil 2.7 instead of ad hoc parsing of human-readable "fossil branch"
output. Not only does this fix a stray space in the output, it's more
robust against changes in command output in general.
Closes#11138