Codex CLI commit log with "\n" in the message
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:
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.
You can try to create a prompt in ~/.codex/prompts/commit.md.
Create a git commit with detailed log using zh-tw.
**When adding new lines to commit message, use multiple `-m`s**. Example: `git commit -m "feat: new feature" -m "- description of the feature 1" -m "- description of the feature 2"`.
then write /commit into prompt line
Feel 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:
```
git commit -m 'feat: new feature
- description of the feature 1
- description of the feature 2'\''s sub-feature
'
```