From 54ea449394250453ac24f668715eec485fba5055 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 9 Aug 2024 07:55:38 -0300 Subject: [PATCH] feat: Use provided argument as basename for clipboard image tempfile --- aider/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 0214294a3..8c528a072 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -901,7 +901,8 @@ class Commands: # Check for image first image = ImageGrab.grabclipboard() if isinstance(image, Image.Image): - with tempfile.NamedTemporaryFile(suffix=".png", delete=False) as temp_file: + basename = args.strip() if args.strip() else "clipboard_image" + with tempfile.NamedTemporaryFile(prefix=f"{basename}_", suffix=".png", delete=False) as temp_file: image.save(temp_file.name, "PNG") temp_file_path = temp_file.name