https://github.com/JanDeDobbeleer/oh-my-posh/issues/7718 this issue reports that the…
- User
https://github.com/JanDeDobbeleer/oh-my-posh/issues/7718 this issue reports that the
posh-gitstring now effectively breaks, which is true because we changed something to strip ANSI escape sequences. I want to keep that documentation, which still contains the explanation to useposh-gitstring, but in reality I want people to move towards using the populated JSON (which we do to populate the normal hit segment using the normal template) and not this ANSI-driven environment variable.We need to update the docs: either remove that part or adjust it so that it talks about how to enable it. Maybe it's already there. I did not check, so validate that, and then we can close this issue with that guideline. Maybe also make an FAQ item on "Hey, this does not render anymore. How do I then migrate from the
posh-gitstring environment variable to enablingposh-gitand leveraging this correctly?" Assistant
Got doc section. Fetching issue 7718 for exact repro/ask now.
Assistant
Confirmed:
source: "pwsh"populates the normal git segment fields (JSON-driven, not raw ANSI) from the posh-git module. Good, that's the real fix path to document.Analysis done. Here's the finding, no code go-changes here, docs only.
Root cause: PR #7711 (ANSI stripping) breaks
POSH_GIT_STRINGbecause that variable carries raw ANSI escapes — expected collateral, not a bug to revert.Docs gap: git.mdx still shows the
POSH_GIT_STRINGsnippet as the way to get posh-git output, no warning it now breaks, no pointer to the real fix:options.source: "pwsh"on the git segment already fetches posh-git module data and populates normal template fields (.Staging,.Workingetc) — no ANSI involved. No FAQ entry exists for this at all.Plan:
- Keep the
posh-gitsection in git.mdx (forPOSH_GIT_STRING-string purists) but add a warning that raw ANSI is stripped since v29.35.1, and steer tosource: "pwsh"as the supported route.
- Keep the
- User
go ahead and we should also add a sample segment that reproduces the way posh-git displays the git changes by default. Execute the default prompt analysis by looking at the posh-git source code using a sub-agent.
Assistant
Sub-agent digging into posh-git source now, background. While it runs I'll draft the doc edits.
Assistant
Noted markdown rules. Waiting on posh-git sub-agent for exact default format before writing template.
Assistant
addsprig func confirmed available. Now writing the doc updates.Assistant
Now add the reference link for faq-posh-git and check surrounding link list.
Assistant
Now add the FAQ entry.
Assistant
Now add the reference links to faq.mdx's link list.
Assistant
Both files edited. Running markdownlint per skill requirement.
Assistant
Confirming no new lint regressions now.
Assistant
Only remaining new violation matches the existing pattern (long Config template line, same as every other segment doc). Good.
Now verify the template logic against the worked example by building a quick check.
Assistant
Matches the expected
[main ↑2 +2 ~1 -0 | +1 ~3 -0 !]from the sub-agent's posh-git default-format research exactly. Cleaning up the scratch package.Assistant
Clean. Only the two docs files touched. Both changes match repo conventions (markdownlint clean except pre-existing long-Config-template-line pattern) and the template's verified against posh-git's actual default output.
Ready to commit. Suggested message:
docs(git): steer posh-git users to source: pwsh, add FAQ for ANSI stripping. Go ahead?