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
# always display, even on very limited terminals.
ascii_frames = """
[#=-----]
[=#-----]
[-=#----]
[--=#---]
[---=#--]
[----=#-]
[-----=#]
[-----#=]
[----#=-]
[---#=--]
[--#=---]
[-#=----]
[#=- ]
[=# ]
[-=# ]
[ -=# ]
[ -=# ]
[ -=# ]
[ -=#]
[ #=]
[ #=-]
[ #=- ]
[ #=- ]
[ #=- ]
""".strip().splitlines()
xlate = ("-=#", "≈≋≣")
# If unicode is supported, swap the ASCII chars for nicer glyphs.
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]
else:
scan_char, _ = "#", "-"