@@ -286,7 +286,11 @@ class AsyncAlert:
286286 """Contents of an asynchonous alert which display while user is at prompt.
287287
288288 :param msg: an optional message to be printed above the prompt.
289- :param prompt: an optional string to dynamically replace the current prompt.
289+ :param prompt: an optional string to dynamically replace the active prompt.
290+
291+ :ivar timestamp: monotonic creation time of the alert. If an alert was created
292+ before the active prompt started, the prompt update is ignored
293+ to avoid a stale display but the msg will still be displayed.
290294 """
291295
292296 msg : str | None = None
@@ -3367,7 +3371,7 @@ def _process_alerts(self) -> None:
33673371 # Get the next alert while still holding the condition lock.
33683372 alert = self ._alert_queue .get ()
33693373
3370- # Only apply prompt changes generated after the current prompt started.
3374+ # Only apply prompt changes generated after the active prompt started.
33713375 prompt_updated = False
33723376 if (alert .prompt is not None and
33733377 alert .prompt != self .prompt and
@@ -3376,7 +3380,7 @@ def _process_alerts(self) -> None:
33763380 prompt_updated = True
33773381
33783382 if alert .msg :
3379- # Print the message above the current prompt.
3383+ # Print the message above the active prompt.
33803384 with patch_stdout ():
33813385 print_formatted_text (pt_filter_style (alert .msg ))
33823386
@@ -5313,7 +5317,7 @@ def add_alert(self, *, msg: str | None = None, prompt: str | None = None) -> Non
53135317 add_alert(msg="Done", prompt="> ") # Update both
53145318
53155319 :param msg: an optional message to be printed above the prompt.
5316- :param prompt: an optional string to dynamically replace the current prompt.
5320+ :param prompt: an optional string to dynamically replace the active prompt.
53175321
53185322 """
53195323 if msg is None and prompt is None :
0 commit comments