gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Shell commands are generated with incorrect escaping

Open cornmander opened this issue 2 months ago • 2 comments

What happened?

When the model generates shell command contents that contain backticks, like a git commit description that contains a markdown code block, the code block isn't being escaped. This causes the shell command tool to execute the backtick block as if it were a shell command.

Image Image

What did you expect to happen?

The model should escape backtick characters in text blocks.

Client information

Ran at HEAD@73b1afb1062a49a8d94b7db13458f099e0d770cb

Login information

No response

Anything else we need to know?

No response

cornmander avatar Oct 22 '25 18:10 cornmander

i can confirm this issue.

tiberiuichim avatar Nov 16 '25 10:11 tiberiuichim

I always have to tell gemini-cli to use temporary files for commit messages (git commit -F ${file}) because it tends to put identifiers in markdown format (with backticks) into the message. Then it feeds commands like git commit -m "Changed function name `sum` to `sum_list`" to the shell which results in one error message per identifier and empty strings instead of identifiers.

IngmarStein avatar Dec 11 '25 14:12 IngmarStein