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
{{ message }}
Repository navigation
Auto-detected links with new lines result in 404s when clicked #3718
bugSomething isn't workinggh-issuerelating to the gh issue commandgh-prrelating to the gh pr commandhelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic
The rendering is done by github.com/yuin/goldmark which is currently only applying coloring for rendered markdown, and I've opened more of a feature request for OSC 8 support. This might be more of a tracking bug until that issue is resolved, but I wanted to note the current behavior.
Expected vs actual behavior
Rendered links in the output are clickable and result in the proper resource being fetched.
Looking to address this, I see that yuin/goldmark is only providing the parsing and rendering visitor, while charmbracelet/glamour is actually doing the rendering. There's also already an issue open for this: charmbracelet/glamour#114.
Reacted by Mislav Marohnić, Sam Coe and Carl Walsh
I see that charmbracelet/glamour is still v0.10.0 when they have a v2 available. In fact, you use several v2 charmbracelet modules currently. I updated cli/go-gh already and it was not very disruptive: cli/go-gh#281
I recommend upgrading here. Would also likely reduce binary size a bit since it would share a single version of lipgloss. I doubt comdat folding would apply across such a large version mismatch that exists now.
And, yes, this still repros today on that same command line above:
My PR for go-gh fixed the issue just by upgrading glamour. The only change to output was some elision of 0 in reset codes e.g., \e[0m -> \e[m. Both are effectively equivalent.
Replacing github.com/cli/go-gh/v2 with github.com/heaths/go-gh/v2 issue279 from cli/go-gh#281 and updating both glamour and lipgloss in cli/cli, there are a couple of differences due to lipgloss itself since both v1 and v2 were used here. Lipgloss v2 appears more aggressive when wrapping lines or padding columns:
@@ -38,4 +38,4 @@
Bash: Check if there are any existing scripts or build files
-$ cd /home/runner/work/foo/foo && find . -name "*.sh" -o -name "Makefile" -- o -name "package.json" -o -name "*.yml" -o -name "*.yaml"+$ cd /home/runner/work/foo/foo && find . -name "*.sh" -o -name "Makefile"+ -o -name "package.json" -o -name "*.yml" -o -name "*.yaml"@@ -1,7 +1,7 @@-Assigned Issues │ Assigned Pull Requests-Nothing here ^_^ │ Nothing here ^_^- │-Review Requests │ Mentions-Nothing here ^_^ │ Nothing here ^_^- │+Assigned Issues │ Assigned Pull Requests+Nothing here ^_^ │ Nothing here ^_^+ │+Review Requests │ Mentions+Nothing here ^_^ │ Nothing here ^_^+ │
Looking into what, if anything, could be done. Also wondering how much it matters since they are to a TTY so only visual. Should not impact programmatic reads e.g., via --json nor agentic reads. /cc @BagToad
Copilot analysis reveals these are actually due to fixes, though the new line between -o seems highly sus.
Reviewed Lip Gloss release notes from the old pseudo-v1 dependency
to charm.land/lipgloss/v2 v2.0.5 , plus the v2 upgrade guide and
source changes.
Release notes point to more correct wrapping/measurement in v2
( v2.0.2 table wrapping fix, v2.0.5 grapheme fixes), but they do
not expose a compatibility mode for old layout width semantics.
The strongest explanation for the status regression is a v2
rendering change: Style.Render() now subtracts horizontal border
size from Width() before wrapping/alignment. With
BorderRight(true) , that removes one content column and causes the
earlier wraps/tighter spacing you saw.
x/ansi also moved toward displaywidth and grapheme-aware
measurement, which can affect Unicode-heavy wrapping, but that is
probably secondary for the ASCII-only status output.
There is no Lip Gloss v2 API toggle to restore the old Width()
behavior globally. The practical fix is in our layout code: compensate
for bordered blocks by adding border width back into Width() (for
this case, likely halfWidth + 1 on the bordered left column), or
render content first and border it separately.
Investigating further on the -o wrap it's because the line broke one cell earlier before, but with the grapheme-based measurements everything has shifted a little. Again, though, sounds like this is a warranted fix since it was wrong before and only affects TTY output. IMO, this isn't breaking:
The -o behavior is a separate transcript-rendering issue, not the
pkg/cmd/status border-width issue.
Bash transcript content is rendered as a fenced markdown code block
and then wrapped through Glamour via go-gh; that path is not shell-
aware.
Hyphens are legal wrap points in this stack, so -o is allowed to
split at all.
I verified the moved breakpoint is not just a one-cell width
change. Old Glamour ( github.com/charmbracelet/glamour v0.10.0 ) used
ansi.Wordwrap(..., " ,.;-+|") ; new Glamour ( charm.land/glamour/v2
v2.0.1 ) uses lipgloss.Wrap(..., " ,.;-+|") .
At the same width, those two algorithms place the break
differently: the old Wordwrap path can leave the hyphen at end-of-
line and continue the token on the next line, while the new Wrap
path can break before the hyphen-led token instead. That is why it
split earlier before, but not now.
So the answer is: the breakpoint moved because the upstream
wrapping algorithm changed, even though both still treat - as a
valid breakpoint. If we need “shell switches must never be split,” the
fix has to be in how we render shell transcript/code-block content,
not in a Lip Gloss compatibility toggle.
Thanks @heaths, these look like an acceptable amount of format changes to me. Thanks for testing it out. Let's try and get the go-gh PR merged. There's some conflicts on that PR, but it otherwise LGTM.
bugSomething isn't workinggh-issuerelating to the gh issue commandgh-prrelating to the gh pr commandhelp wantedContributions welcomepriority-3Affects a small number of users or is largely cosmetic
Activity
mislav commentedon May 26, 2021
Thanks for reporting!
Agreed that URLs should never get hard-wrapped, and that this needs to be solved on Glamour level.
Ref. #3640
heaths commentedon Jun 4, 2021
Looking to address this, I see that yuin/goldmark is only providing the parsing and rendering visitor, while charmbracelet/glamour is actually doing the rendering. There's also already an issue open for this: charmbracelet/glamour#114.
heaths commentedon Aug 14, 2026
I see that charmbracelet/glamour is still v0.10.0 when they have a v2 available. In fact, you use several v2 charmbracelet modules currently. I updated cli/go-gh already and it was not very disruptive: cli/go-gh#281
I recommend upgrading here. Would also likely reduce binary size a bit since it would share a single version of lipgloss. I doubt comdat folding would apply across such a large version mismatch that exists now.
And, yes, this still repros today on that same command line above:
My PR for go-gh fixed the issue just by upgrading glamour. The only change to output was some elision of
0in reset codes e.g.,\e[0m->\e[m. Both are effectively equivalent.heaths commentedon Aug 14, 2026
Replacing
github.com/cli/go-gh/v2withgithub.com/heaths/go-gh/v2 issue279from cli/go-gh#281 and updating both glamour and lipgloss incli/cli, there are a couple of differences due to lipgloss itself since both v1 and v2 were used here. Lipgloss v2 appears more aggressive when wrapping lines or padding columns:Looking into what, if anything, could be done. Also wondering how much it matters since they are to a TTY so only visual. Should not impact programmatic reads e.g., via
--jsonnor agentic reads. /cc @BagToadheaths commentedon Aug 14, 2026
Copilot analysis reveals these are actually due to fixes, though the new line between
-oseems highly sus.to charm.land/lipgloss/v2 v2.0.5 , plus the v2 upgrade guide and
source changes.
( v2.0.2 table wrapping fix, v2.0.5 grapheme fixes), but they do
not expose a compatibility mode for old layout width semantics.
rendering change: Style.Render() now subtracts horizontal border
size from Width() before wrapping/alignment. With
BorderRight(true) , that removes one content column and causes the
earlier wraps/tighter spacing you saw.
measurement, which can affect Unicode-heavy wrapping, but that is
probably secondary for the ASCII-only status output.
behavior globally. The practical fix is in our layout code: compensate
for bordered blocks by adding border width back into Width() (for
this case, likely halfWidth + 1 on the bordered left column), or
render content first and border it separately.
Investigating further on the
-owrap it's because the line broke one cell earlier before, but with the grapheme-based measurements everything has shifted a little. Again, though, sounds like this is a warranted fix since it was wrong before and only affects TTY output. IMO, this isn't breaking:pkg/cmd/status border-width issue.
and then wrapped through Glamour via go-gh; that path is not shell-
aware.
split at all.
change. Old Glamour ( github.com/charmbracelet/glamour v0.10.0 ) used
ansi.Wordwrap(..., " ,.;-+|") ; new Glamour ( charm.land/glamour/v2
v2.0.1 ) uses lipgloss.Wrap(..., " ,.;-+|") .
differently: the old Wordwrap path can leave the hyphen at end-of-
line and continue the token on the next line, while the new Wrap
path can break before the hyphen-led token instead. That is why it
split earlier before, but not now.
wrapping algorithm changed, even though both still treat - as a
valid breakpoint. If we need “shell switches must never be split,” the
fix has to be in how we render shell transcript/code-block content,
not in a Lip Gloss compatibility toggle.
heaths commentedon Aug 15, 2026
go run ./cmd/gh pr -R cli/cli view 3519 --commentsnow works:BagToad commentedon Sep 1, 2026
Thanks @heaths, these look like an acceptable amount of format changes to me. Thanks for testing it out. Let's try and get the go-gh PR merged. There's some conflicts on that PR, but it otherwise LGTM.
heaths commentedon Sep 4, 2026
@BagToad I've rebased cli/go-gh#281
Update glamour to v2
Update glamour to v2
Update glamour to v2