mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
fix: add error handling for clipboard operations in copy_context command
This commit is contained in:
parent
b7984a05af
commit
730e5bd831
1 changed files with 10 additions and 2 deletions
|
@ -1447,8 +1447,16 @@ Just show me the edits I need to make.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pyperclip.copy(markdown)
|
try:
|
||||||
self.io.tool_output("Copied code context to clipboard.")
|
pyperclip.copy(markdown)
|
||||||
|
self.io.tool_output("Copied code context to clipboard.")
|
||||||
|
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."
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
self.io.tool_error(f"An unexpected error occurred while copying to clipboard: {str(e)}")
|
||||||
|
|
||||||
|
|
||||||
def expand_subdir(file_path):
|
def expand_subdir(file_path):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue