TUI copies left padding spaces from code blocks

Open 💬 0 comments Opened Jul 16, 2026 by pawkon

When using Codex CLI in the terminal TUI, assistant messages and fenced code blocks are rendered with a two-space left padding/gutter. When selecting and copying code from the terminal, these two leading spaces are copied as part of every line.

This makes pasted shell scripts, Python heredocs, YAML, and other indentation-sensitive snippets invalid or annoying to clean manually.

Tested with:

  • Codex CLI 0.142.4
  • normal TUI mode
  • --no-alt-screen
  • terminal scrollback copy still includes the same two leading spaces

Expected behavior:
Copying a fenced code block should copy only the code content, without TUI layout padding.

Actual behavior:
Every copied line starts with two extra spaces.

Request:
Add a way to copy code blocks without layout padding, or add a config/flag to render assistant code blocks without the left gutter/padding.

View original on GitHub ↗