Character Encoding Error with Multiple Commands Execution
Which API Provider are you using?
Google Gemini
Which Model are you using?
flash
What happened?
Description When the user tries to execute a command that includes multiple chained commands, a character encoding issue occurs.
Example The user is attempting to run the following command:
cd gemini-prompt-enhancer && npm run dev
However, the && characters appear to be misinterpreted by the terminal, causing an encoding error.
Environment
- Operating System: Windows
Additional Context This issue specifically affects the && characters used to chain commands.
Steps to reproduce
- Ask Cline to make a program or a change
- Cline wants to execute a command
Relevant API REQUEST output
No response
Additional context
No response
Seems to me as a Google Gemini issue, just tested and ran into the same issue. Other models work fine.
@JackAdamsJenkins I suggest to just replace them out in post processing, now that we've done the same to < > and " here https://github.com/cline/cline/blob/4658e5ceadffc1361bb9604e656b2880f083cb3b/src/core/Cline.ts#L1036-L1045
This is really annoying when generating c++ code which uses references.
For furthur solution, maybe it's possible to mention this in system prompt to prevent LLM from outputing HTML entities?
UPD: Created a PR
This is still a valid issue. Why is nothing happening?
@canvrno
@p30arena which model has this occurred with?
Question is: Why is it working for Anthropic models (Api and LM API) then?
Oh, that's why https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/utils/string.ts#L6-L13 https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/core/Cline.ts#L1751-L1755 https://github.com/cline/cline/blob/616d56468f5097cb6ebb14a223bbe2e11730c406/src/core/Cline.ts#L1796-L1800
Same issue. Workaround is to reject gemini's first command, prompt it that rejection was because you need it to replace all "amp&;amp&" with "&&". It then resumes with working commands.
Hey guys, we pushed a fix on Monday. Please try again, it should be fixed as of the latest version.
with v3.17.9 and gemini-2.5-pro-preview-05-06 i still see that same exact issue