chore: Improve spinner ASCII animation

This commit is contained in:
Paul Gauthier 2025-05-08 17:17:01 -07:00 committed by Paul Gauthier (aider)
parent 95cc362c07
commit aad6838e15

View file

@ -270,23 +270,25 @@ class Spinner:
# Pre-render the animation frames using pure ASCII so they will # Pre-render the animation frames using pure ASCII so they will
# always display, even on very limited terminals. # always display, even on very limited terminals.
ascii_frames = """ ascii_frames = """
[#=-----] [#=- ]
[=#-----] [=# ]
[-=#----] [-=# ]
[--=#---] [ -=# ]
[---=#--] [ -=# ]
[----=#-] [ -=# ]
[-----=#] [ -=#]
[-----#=] [ #=]
[----#=-] [ #=-]
[---#=--] [ #=- ]
[--#=---] [ #=- ]
[-#=----] [ #=- ]
""".strip().splitlines() """.strip().splitlines()
xlate = ("-=#", "≈≋≣")
# If unicode is supported, swap the ASCII chars for nicer glyphs. # If unicode is supported, swap the ASCII chars for nicer glyphs.
if self._supports_unicode(): if self._supports_unicode():
scan_char, trail_char = "", "" scan_char, trail_char = "", ""
frames = [f.replace("#", scan_char).replace("-", trail_char) for f in ascii_frames] frames = [f.replace("#", scan_char).replace("-", trail_char) for f in ascii_frames]
else: else:
scan_char, _ = "#", "-" scan_char, _ = "#", "-"