mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
feat: Add terminal-notifier support for macOS notifications
This commit is contained in:
parent
3da15bfd19
commit
47254be254
1 changed files with 11 additions and 4 deletions
|
@ -967,6 +967,10 @@ class InputOutput:
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
|
|
||||||
if system == "Darwin": # macOS
|
if system == "Darwin": # macOS
|
||||||
|
# Check for terminal-notifier first
|
||||||
|
if shutil.which("terminal-notifier"):
|
||||||
|
return "terminal-notifier -title 'Aider' -message 'Aider is waiting for your input'"
|
||||||
|
# Fall back to osascript
|
||||||
return (
|
return (
|
||||||
'osascript -e \'display notification "Aider is waiting for your input" with title'
|
'osascript -e \'display notification "Aider is waiting for your input" with title'
|
||||||
' "Aider"\''
|
' "Aider"\''
|
||||||
|
@ -996,7 +1000,10 @@ class InputOutput:
|
||||||
if self.bell_on_next_input and self.notifications:
|
if self.bell_on_next_input and self.notifications:
|
||||||
if self.notifications_command:
|
if self.notifications_command:
|
||||||
try:
|
try:
|
||||||
subprocess.run(self.notifications_command, shell=True)
|
result = subprocess.run(self.notifications_command, shell=True, capture_output=True)
|
||||||
|
if result.returncode != 0 and result.stderr:
|
||||||
|
error_msg = result.stderr.decode('utf-8', errors='replace')
|
||||||
|
self.tool_warning(f"Failed to run notifications command: {error_msg}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.tool_warning(f"Failed to run notifications command: {e}")
|
self.tool_warning(f"Failed to run notifications command: {e}")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue