Codex CLI commit log with "\n" in the message
Resolved 💬 3 comments Opened Sep 3, 2025 by doggy8088 Closed Sep 3, 2025
💡 Likely answer: A maintainer (gpeal, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.28.0
Which model were you using?
gpt-5
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
What steps can reproduce the bug?
- Write some code
- Enter this prompt:
git commit with detailed log using zh-tw
What is the expected behavior?
I expected the newline to be rendered correctly.
What do you see instead?
The result:
<img width="1869" height="640" alt="Image" src="https://github.com/user-attachments/assets/55ae3789-a587-4158-a41e-1ff0d41e29eb" />
The "\n" is wrong.
Additional information
I have to rewrite the prompt like this:
rewrite your log. The newline must be REAL newline. amend it.
I believe this requirement is common. Instructions for how to perform a Git commit should be included in the default system prompt.
3 Comments
You can try to create a prompt in
~/.codex/prompts/commit.md.then write
/commitinto prompt lineFeel free to do what @michalkos mentioned or add it to your AGENTS.md
Here is the prompt of mine:
~/.codex/prompts/commit.md
`````
Create a git commit with detailed log using zh-tw.
When adding new lines to commit message, use single quote to multi-line text..
If there is a single quote in the message, use standard bash syntax to escape that single quote.
Example:
`````