diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 96b081bbd..cf5d570b6 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -31,6 +31,7 @@ ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*! 4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks. Just suggest shell commands this way, not example code. +Only suggest complete shell commands that area ready to execute, without placeholders. Use the appropriate shell based on the user's system info: {platform} diff --git a/tests/basic/test_commands.py b/tests/basic/test_commands.py index b6cee63f6..45b5dc90c 100644 --- a/tests/basic/test_commands.py +++ b/tests/basic/test_commands.py @@ -452,6 +452,29 @@ class TestCommands(TestCase): commands.cmd_add(str(dname)) + dump(coder.abs_fnames) + self.assertIn(str(fname.resolve()), coder.abs_fnames) + + def test_cmd_add_dirname_with_special_chars_git(self): + with GitTemporaryDirectory(): + io = InputOutput(pretty=False, yes=False) + from aider.coders import Coder + + coder = Coder.create(self.GPT35, None, io) + commands = Commands(io, coder) + + dname = Path("with[brackets]") + dname.mkdir() + fname = dname / "filename.txt" + fname.touch() + + repo = git.Repo() + repo.git.add(str(fname)) + repo.git.commit("-m", "init") + + commands.cmd_add(str(dname)) + + dump(coder.abs_fnames) self.assertIn(str(fname.resolve()), coder.abs_fnames) def test_cmd_add_abs_filename(self):