What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Business
Which model were you using?
gpt-5.4 xhigh fast
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
WezTerm 20240203-110809-5046fc22 (latest version. not the nightly channel)
What issue are you seeing?
When codex renders a markdown link like [PR #496](https://github.com/org/repo/pull/496), the TUI output looks like:
PR #496 (https://github.com/org/repo/pull/496)
The problem is terminal emulators (WezTerm, iTerm2, Terminal.app, etc.) include the trailing ) in the clickable URL — so you end up navigating to https://github.com/org/repo/pull/496) which 404s.
What steps can reproduce the bug?
- Have codex output any markdown link to a remote URL (e.g. a PR link)
- Click the rendered URL in the terminal
- Browser navigates to the URL with a trailing
) appended — 404
What is the expected behavior?
Clicking the URL should navigate to the correct destination without the trailing ).
Additional information
Root cause
pop_link() in codex-rs/tui/src/markdown_render.rs (around line 596) pushes " (", the styled URL, then ")" as separate spans. The closing paren is character-adjacent to the URL, and most terminals' URL detection heuristics will grab it since there's no matching ( inside the URL itself.
self.push_span(" (".into());
self.push_span(Span::styled(link.destination, self.styles.link));
self.push_span(")".into());
Suggested fix
Swap the parens for a separator that won't get captured — something like an em-dash works fine here since the URL is already styled (cyan + underline) so the visual grouping isn't lost:
self.push_span(" — ".into());
self.push_span(Span::styled(link.destination, self.styles.link));
The test url_link_shows_destination in markdown_render_tests.rs would need the same update.
What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Business
Which model were you using?
gpt-5.4 xhigh fast
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
WezTerm 20240203-110809-5046fc22 (latest version. not the nightly channel)
What issue are you seeing?
When codex renders a markdown link like
[PR #496](https://github.com/org/repo/pull/496), the TUI output looks like:The problem is terminal emulators (WezTerm, iTerm2, Terminal.app, etc.) include the trailing
)in the clickable URL — so you end up navigating tohttps://github.com/org/repo/pull/496)which 404s.What steps can reproduce the bug?
)appended — 404What is the expected behavior?
Clicking the URL should navigate to the correct destination without the trailing
).Additional information
Root cause
pop_link()incodex-rs/tui/src/markdown_render.rs(around line 596) pushes" (", the styled URL, then")"as separate spans. The closing paren is character-adjacent to the URL, and most terminals' URL detection heuristics will grab it since there's no matching(inside the URL itself.Suggested fix
Swap the parens for a separator that won't get captured — something like an em-dash works fine here since the URL is already styled (cyan + underline) so the visual grouping isn't lost:
The test
url_link_shows_destinationinmarkdown_render_tests.rswould need the same update.