cli/display: show a cancelled wait distinctly

The wait line rendered every non-error/non-slept outcome as "(disturbed)", so a
Ctrl+C cancellation of the wait prompt looked like the human disturbed it. Print
"(cancelled)" for the tool's "cancelled by user" result.
This commit is contained in:
2026-09-22 19:44:19 +08:00
parent 27bd7b46f7
commit dfd45a1d57
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -444,11 +444,13 @@ def _wait_prefix(_args_json: str) -> str:
def _wait_detail(_args_json: str, result: str) -> str:
"""``wait`` outcome: slept duration, disturbed, or error."""
"""``wait`` outcome: slept duration, disturbed, cancelled, or error."""
if result.startswith("error:"):
return _pretty_segments((f"({result})", "red"))
if result.startswith("waited "):
return _pretty_segments((f"({result.removeprefix('waited ')})", "green"))
if result.startswith("cancelled by user"):
return _pretty_segments(("(cancelled)", "yellow"))
return _pretty_segments(("(disturbed)", "yellow"))