codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI commit log with "\n" in the message

Open doggy8088 opened this issue 1 year ago • 3 comments

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?

  1. Write some code
  2. 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:

Image

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.

doggy8088 avatar Sep 03 '25 07:09 doggy8088

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

michalkos avatar Sep 03 '25 08:09 michalkos

Feel free to do what @michalkos mentioned or add it to your AGENTS.md

gpeal avatar Sep 03 '25 17:09 gpeal

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
'
```

doggy8088 avatar Sep 03 '25 18:09 doggy8088