Skip to content

Bare URLs containing ~ are partially linkified in Codex CLI output #26774

@eamsden

Description

@eamsden

Summary

In Codex CLI 0.136.0, a bare URL containing ~ in the path is rendered/linkified only up to the ~. The rest of the URL is displayed as plain text, so Cmd-click opens an incomplete URL.

This appears to be in the Codex CLI presentation layer rather than the terminal's native URL detection. The same terminal correctly recognizes the full URL when the URL is printed by a normal shell command outside Codex.

Repro

  1. Run Codex CLI in the interactive TUI.

  2. Have the assistant output this bare URL:

    https://www.cs.tufts.edu/~nr/cs257/archive/olin-shivers/dissertation.pdf
    
  3. Observe the rendered URL in the Codex output.

  4. Cmd-hover or Cmd-click the URL.

Actual behavior

Only the portion before the tilde appears to be recognized as a link:

https://www.cs.tufts.edu/

The suffix is not included in the clickable destination:

~nr/cs257/archive/olin-shivers/dissertation.pdf

Cmd-click therefore opens the wrong/incomplete URL.

Expected behavior

The full URL should be recognized and opened:

https://www.cs.tufts.edu/~nr/cs257/archive/olin-shivers/dissertation.pdf

~ is valid in a URL path, so it should not terminate link detection.

Terminal cross-check

The terminal itself handles the full URL correctly outside Codex. Copying the same URL into an echo command in another terminal window does not underline by default, but when hovering while holding Cmd it recognizes the full URL and opens the full URL in the browser when clicked.

That suggests this is either in Codex CLI's rendering/linkification path or in how Codex emits styled/hyperlink spans, not in the terminal's URL parser.

Environment

  • Codex CLI: codex-cli 0.136.0
  • OS: macOS / Darwin arm64
  • Terminal environment observed by Codex:
    • TERM=xterm-256color
    • TERM_PROGRAM=zed
    • shell: /opt/homebrew/bin/bash
  • gh: 2.86.0

Related issues

Possibly related but not identical:

This report is specifically about bare URL linkification stopping at ~ in a URL path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions