Skip to content

Codex CLI pre-fills prompt with OSC palette reply on macOS Terminal #5107

Closed

Description

@ckpublishing

What version of Codex is running?

0.46.0

Which model were you using?

No response

What platform is your computer?

codex running on Linux. ssh from MacOS Terminal to Linux.

What steps can reproduce the bug?

Steps to Reproduce

  1. Open Terminal on macOS and start an SSH session into the Debian host.
  2. Run codex (or any wrapper that just execs it).
  3. Switch away and back to the Codex window, or simply wait for the UI to render the prompt.

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

Environment

  • macOS Terminal (built‑in app) on Mac (user is ssh-ing in; Terminal likely 3.x, macOS 14/15).
  • Remote host: Debian 13 (“Trixie”), kernel 6.12.48+deb13-cloud-amd64.
  • Codex CLI version: 0.46.0 (binary installed via npm at /usr/lib/node_modules/@openai/codex).
  • SSH session using the default login shell (bash) with stock .bashrc.

Observed Result

  • Each time the Codex TUI finishes drawing (especially after Terminal regains focus), a line beginning with the palette response 10;rgb:ffff/ffff/
    ffff11;rgb:2b5f/66a6/c977 appears in the input buffer. The Codex prompt is still there, but the reply from the terminal is pasted into the same line,
    so the user has to manually delete it before typing a command.

Expected Result

  • Codex should consume the terminal’s OSC 10/11 response internally (or not request palette info unless it will handle the reply), leaving the user
    prompt empty.

Notes

  • The string matches Apple Terminal’s OSC 10/11 color reply format (ESC]10;rgb:...BEL). It seems Codex sends the query but doesn’t discard the response,
    so the raw text becomes user input.
  • The issue occurs even with default shell configuration; no prompt hooks are involved.
  • Other terminal emulators (e.g., iTerm2) may or may not echo the same response, but the bug is easiest to reproduce on the stock macOS Terminal.

Workaround Tried

  • Attempted to disable tui.apply_terminal_palette, but Codex still issued the OSC request.
  • Shell-level filters work but are intrusive, so a fix in the CLI would be preferable.

Activity

  1. added
    bug
    on Oct 12, 2025
  2. github-actions commented on Oct 12, 2025

    @github-actions
    Contributor
  3. rewardhacker00 commented on Oct 26, 2025

    @rewardhacker00

    +1 also on linux

  4. Git-on-my-level commented on Oct 28, 2025

    @Git-on-my-level

    Previous discussion: #4945

    Issue not fully resolved yet. I can still reproduce on v0.50.0
    Running via code-server

    Image
  5. nornagon-openai commented on Oct 29, 2025

    @nornagon-openai
    Contributor

    Duplicate of #4945

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions