diff --git a/cecli/io.py b/cecli/io.py index d3cdf0b04d6..53eeb74b6ce 100644 --- a/cecli/io.py +++ b/cecli/io.py @@ -386,6 +386,7 @@ def __init__( self.verbose = verbose self.profile_start_time = None self.profile_last_time = None + self.last_notification_time = 0 # Variables used to interface with base_coder self.coder = None @@ -816,6 +817,7 @@ async def get_input( edit_format=None, ): self.rule() + self.notify_user_input_required() rel_fnames = list(rel_fnames) show = "" @@ -1729,6 +1731,12 @@ def get_default_notification_command(self): return None # Unknown system def _send_notification(self): + # Cooldown to prevent notification spam + current_time = time.time() + if current_time - self.last_notification_time < 2: # 2-second cooldown + return + self.last_notification_time = current_time + if self.notifications_command: try: # Use Popen to run the command in the background without waiting for it diff --git a/cecli/tui/io.py b/cecli/tui/io.py index 845466a2f92..695e67bd52b 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -355,6 +355,8 @@ async def get_input( """ self.interrupted = False + self.notify_user_input_required() + # Signal TUI that we're ready for input command_names = commands.get_commands() if commands else [] @@ -479,6 +481,9 @@ async def confirm_ask( res = group.preference self.user_input(f"{question} - {res}", log_only=False) else: + # Ring the bell to notify user + self.notify_user_input_required() + # Send confirmation request to TUI with full options self.output_queue.put( {