Aider tries to execute search/replace blocks in a terminal shell
Issue
I've been having a lot of issues with diff and edit-diff lately. Aider will try to make edits with search/replace blocks but they fail rapidly and there is no detail about why. Ocassionally it will finish with one sad search/replace block in a different visual format and it will ask if I want the shell to execute it. I mean actually execute the search/replace text. I would guess that this area of aider is evolving quickly so this is mostly fyi and by the time anyone reads this it may already have been resolved. Thank you.
Version and model info
aider 0.81.2 i've been bouncing around between models gemini pro2.5, claude 3.7, and gemini 2.0 flash. I use both code and architect modes. I can't really isolated it to a particular model. I'll pay attention to see if it is related to a model and update this issue if it is.
Does it look like #3811?
I also encountered this situation while editing csharp; it seems that ```csharp was matched as ```csh, causing the command to be invoked.
shell_starts = [
"```bash",
"```sh",
"```shell",
"```cmd",
"```batch",
"```powershell",
"```ps1",
"```zsh",
"```fish",
"```ksh",
"```csh",
"```tcsh",
]
The change is available in the main branch. You can get it by installing the latest version from github:
aider --install-main-branch
# or...
python -m pip install --upgrade --upgrade-strategy only-if-needed git+https://github.com/Aider-AI/aider.git
If you have a chance to try it, let me know if it works better for you.
I ran with the change for one hour of coding and did not see the issue.
Ok, I have done many (~12) hours of coding now with multiple models and editors. I have not seen this issue again. Should I close the issue?
I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.