chore: Update waiting spinner

This commit is contained in:
Paul Gauthier 2025-05-08 17:47:41 -07:00 committed by Paul Gauthier (aider)
parent 4e86a82a08
commit 2d34b738bc
2 changed files with 18 additions and 13 deletions

View file

@ -1419,7 +1419,7 @@ class Coder:
self.multi_response_content = ""
if self.show_pretty():
self.waiting_spinner = WaitingSpinner("Waiting for LLM")
self.waiting_spinner = WaitingSpinner("Waiting for " + self.main_model.name)
self.waiting_spinner.start()
if self.stream:
self.mdstream = self.io.get_assistant_mdstream()

View file

@ -270,21 +270,22 @@ class Spinner:
# Pre-render the animation frames using pure ASCII so they will
# always display, even on very limited terminals.
ascii_frames = """
[#=- ]
[=# ]
[-=# ]
[ -=# ]
[ -=# ]
[ -=# ]
[ -=#]
[#= ]
[ #=-]
[ #=- ]
[ #=- ]
[ #=- ]
[=# ]
[ =# ]
[ =# ]
[ =# ]
[ =# ]
[ =#]
[ #=]
[ #= ]
[ #= ]
[ #= ]
[ #= ]
""".strip().splitlines()
xlate_from, xlate_to = ("-=#", "─=≡")
self.unicode_palette = "≋≣"
xlate_from, xlate_to = ("=#", self.unicode_palette)
# If unicode is supported, swap the ASCII chars for nicer glyphs.
if self._supports_unicode():
@ -305,7 +306,11 @@ class Spinner:
if not self.is_tty:
return False
try:
sys.stdout.write("\b\b \b")
out = self.unicode_palette
out += "\b" * len(self.unicode_palette)
out += " " * len(self.unicode_palette)
out += "\b" * len(self.unicode_palette)
sys.stdout.write(out)
sys.stdout.flush()
return True
except UnicodeEncodeError: