Skip to content

TUI renders percent-encoded bare paths instead of decoded Unicode in local file links #16622

Closed

Description

@OnurUenal

Bug

When a model emits Markdown links with bare (non-file://) path destinations containing percent-encoded characters (e.g. %C3%B6 for ö, %20 for spaces), the TUI transcript renderer displays the raw encoded text instead of the decoded file-system path.

Current behavior:

/Volumes/Archiv%201/Bilder/Pers%C3%B6nliches/Kleidung/

Expected behavior:

/Volumes/Archiv 1/Bilder/Persönliches/Kleidung/

Root cause

In codex-rs/tui/src/markdown_render.rs, function parse_local_link_target():

  • The file:// URL code path correctly decodes via Url::to_file_path()
  • But bare paths (starting with /, ~/, ./) are passed through expand_local_link_path() without percent-decoding

Fix

Add urlencoding::decode() before expand_local_link_path() (line ~792):

// Before:
Some((expand_local_link_path(path_text), location_suffix))

// After:
let decoded = urlencoding::decode(path_text).unwrap_or(std::borrow::Cow::Borrowed(path_text));
Some((expand_local_link_path(&decoded), location_suffix))

Also add urlencoding = { workspace = true } to codex-rs/tui/Cargo.toml (already in workspace deps).

Branch with full fix + test: https://github.com/OnurUenal/codex/tree/fix/decode-percent-encoded-bare-paths

Activity

  1. added
    bug
    CLI
    TUI
    on Apr 2, 2026
  2. removed
    CLI
    on Apr 2, 2026
  3. etraut-openai commented on Apr 2, 2026

    @etraut-openai
    Contributor

    Which version of the TUI are you using, and which platform?

    Do you have deterministic repro steps?

  4. added a commit that references this issue on Apr 3, 2026
    f5b8480
  5. self-assigned this
    on Apr 4, 2026
  6. etraut-openai commented on Apr 6, 2026

    @etraut-openai
    Contributor

    Thanks for the bug report. This will be fixed in the next release.

  7. 14 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

TUIbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions