Remove Rich link styling from project URL output#1784
Merged
alexmojaki merged 1 commit intopydantic:mainfrom Mar 20, 2026
Merged
Remove Rich link styling from project URL output#1784alexmojaki merged 1 commit intopydantic:mainfrom
alexmojaki merged 1 commit intopydantic:mainfrom
Conversation
The Rich `[link=...]` markup emits OSC 8 terminal hyperlink escape sequences which break output in Google Colab and IPython environments, especially when the URL is printed from a background thread. Replace the link markup with plain cyan styling so the URL remains visible and colored but no longer produces escape sequences that interfere with notebook output handling. Fixes pydantic#1267
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the Rich
[link=...]markup from the project URL console output, replacing it with plain[cyan]styling.Problem
Rich's
[link=...]markup emits OSC 8 terminal hyperlink escape sequences. These escape sequences break output in Google Colab and IPython environments — particularly when the project URL is printed from a background thread duringlogfire.configure(), the escape sequences interfere with Colab's output handling and can swallow subsequentprint()output entirely.See the detailed investigation in #1267.
Fix
[link={url} cyan]{url}[/link]with[cyan]{url}[/cyan]inprint_token_summary()ThemeandStyleimports from_print_summary()(they were only used to customize the link color)The URL remains visible and cyan-colored in terminals that support Rich markup, but no longer emits hyperlink escape sequences.
Test plan
test_configure.pyandtest_cli.pypass (162/162) — they assert on the rendered text viacapsys, which is unchangedruff format,ruff check, andpyrightall passFixes #1267
Summary by cubic
Remove Rich hyperlink markup from the project URL output. Use plain cyan text to avoid OSC 8 sequences that break Google Colab and IPython output.
[cyan]{url}[/cyan]instead of[link={url} cyan]{url}[/link]inprint_token_summary().Theme/Style; use defaultConsole.Written for commit 17be3c8. Summary will update on new commits.