fix: Catch KeyboardInterrupt in main and end spinner

This commit is contained in:
Paul Gauthier (aider) 2025-05-09 09:51:44 -07:00
parent fcc85a7ae6
commit 91d7fbd659

View file

@ -489,11 +489,15 @@ def printable_shell_command(cmd_list):
def main(): def main():
spinner = Spinner("Running spinner...") spinner = Spinner("Running spinner...")
for _ in range(100): try:
time.sleep(0.15) for _ in range(100):
spinner.step() time.sleep(0.15)
spinner.end() spinner.step()
print("Success!") print("Success!")
except KeyboardInterrupt:
print("\nInterrupted by user.")
finally:
spinner.end()
if __name__ == "__main__": if __name__ == "__main__":