rendered markdown links include trailing ')' in clickable URL
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start in codex-rs/tui/src/markdown_render.rs at pop_link(), which currently renders the URL with surrounding parentheses. Update the rendering so terminal URL detection excludes punctuation, then update and run url_link_shows_destination in markdown_render_tests.rs. Done means the rendered link has the revised separator and clicking it does not include a trailing ')'.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
CLI enhancement model-behavior
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100