Skip to content
8 changes: 8 additions & 0 deletions cecli/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -816,6 +817,7 @@ async def get_input(
edit_format=None,
):
self.rule()
self.notify_user_input_required()

rel_fnames = list(rel_fnames)
show = ""
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions cecli/tui/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down Expand Up @@ -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(
{
Expand Down
Loading