bug[cli] :: gh comment body may post literal \n sequences
Open 💬 2 comments Opened Mar 6, 2026 by bniladridas
Summary
When Codex posts GitHub issue comments via shell/gh, escaped newline sequences can be sent literally (e.g., \\n) instead of rendered as actual line breaks.
Expected
- Multiline comment text renders with real new lines.
Actual
- Comment contains literal
\\ntext.
Repro (high level)
- Use Codex to post an issue comment via shell command with escaped newlines in a quoted body.
- Observe rendered comment contains backslash-n sequences.
Evidence
- Downstream tracking issue documenting the behavior: https://github.com/bniladridas/browser/issues/362
- Affected comments:
- https://github.com/bniladridas/browser/issues/358#issuecomment-4010468673
- https://github.com/bniladridas/browser/issues/358#issuecomment-4010469458
- https://github.com/bniladridas/browser/issues/358#issuecomment-4010472889
- Correctly formatted follow-up (HEREDOC body):
- https://github.com/bniladridas/browser/issues/358#issuecomment-4010474953
Suggested fix
- In Codex command generation, avoid escaped newline literals for GH comment bodies; prefer HEREDOC-style body composition or explicit multiline payload handling.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗