diff --git a/aider/commands.py b/aider/commands.py index e16586203..74a0dd956 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1172,11 +1172,17 @@ class Commands: try: pyperclip.copy(last_assistant_message) - preview = last_assistant_message[:50] + "..." if len(last_assistant_message) > 50 else last_assistant_message + preview = ( + last_assistant_message[:50] + "..." + if len(last_assistant_message) > 50 + else last_assistant_message + ) self.io.tool_output(f"Copied last assistant message to clipboard. Preview: {preview}") except pyperclip.PyperclipException as e: self.io.tool_error(f"Failed to copy to clipboard: {str(e)}") - self.io.tool_output("You may need to install xclip or xsel on Linux, or pbcopy on macOS.") + self.io.tool_output( + "You may need to install xclip or xsel on Linux, or pbcopy on macOS." + ) except Exception as e: self.io.tool_error(f"An unexpected error occurred while copying to clipboard: {str(e)}")