mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: Add --notifications flag to control terminal bell
This commit is contained in:
parent
665ffe3984
commit
2fe1b1e16e
2 changed files with 9 additions and 1 deletions
|
@ -813,6 +813,12 @@ def get_parser(default_config_files, git_root):
|
||||||
default=False,
|
default=False,
|
||||||
help="Enable/disable multi-line input mode with Meta-Enter to submit (default: False)",
|
help="Enable/disable multi-line input mode with Meta-Enter to submit (default: False)",
|
||||||
)
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--notifications",
|
||||||
|
action=argparse.BooleanOptionalAction,
|
||||||
|
default=False,
|
||||||
|
help="Enable/disable terminal bell notifications when LLM responses are ready (default: False)",
|
||||||
|
)
|
||||||
group.add_argument(
|
group.add_argument(
|
||||||
"--detect-urls",
|
"--detect-urls",
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
|
|
|
@ -236,6 +236,7 @@ class InputOutput:
|
||||||
file_watcher=None,
|
file_watcher=None,
|
||||||
multiline_mode=False,
|
multiline_mode=False,
|
||||||
root=".",
|
root=".",
|
||||||
|
notifications=False,
|
||||||
):
|
):
|
||||||
self.placeholder = None
|
self.placeholder = None
|
||||||
self.interrupted = False
|
self.interrupted = False
|
||||||
|
@ -243,6 +244,7 @@ class InputOutput:
|
||||||
self.editingmode = editingmode
|
self.editingmode = editingmode
|
||||||
self.multiline_mode = multiline_mode
|
self.multiline_mode = multiline_mode
|
||||||
self.bell_on_next_input = False
|
self.bell_on_next_input = False
|
||||||
|
self.notifications = notifications
|
||||||
no_color = os.environ.get("NO_COLOR")
|
no_color = os.environ.get("NO_COLOR")
|
||||||
if no_color is not None and no_color != "":
|
if no_color is not None and no_color != "":
|
||||||
pretty = False
|
pretty = False
|
||||||
|
@ -951,7 +953,7 @@ class InputOutput:
|
||||||
|
|
||||||
def ring_bell(self):
|
def ring_bell(self):
|
||||||
"""Ring the terminal bell if needed and clear the flag"""
|
"""Ring the terminal bell if needed and clear the flag"""
|
||||||
if self.bell_on_next_input:
|
if self.bell_on_next_input and self.notifications:
|
||||||
print("\a", end="", flush=True) # Ring the bell
|
print("\a", end="", flush=True) # Ring the bell
|
||||||
self.bell_on_next_input = False # Clear the flag
|
self.bell_on_next_input = False # Clear the flag
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue