openai / openai/codex

Copying text adds leading spaces

Open
#44,371 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug TUI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Copying assistant command snippets adds two leading spaces to every line.
This breaks top-level Python with IndentationError and prevents Bash heredoc
terminators from being recognized, leaving the shell at the > prompt. The
assistant repeatedly supplied affected snippets and initially blamed my
pasting. Please investigate code-copy whitespace preservation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported copy behavior with a top-level Python snippet and a Bash heredoc in the terminal. Trace how assistant command snippets are rendered and copied, then verify that copied lines preserve their original leading whitespace and that both examples execute without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.