yaspin
yaspin copied to clipboard
Strange spinner behavior in windows terminal
Hello!
I have a simple multi-platform app (it's designed for windows and linux environments). Everything works fine for bash terminal, but there is a problem when I start my app on windows. Few firsts lines is printed with strange symbols but, after that everything is fine and my spinner appears: app.exe > output.txt From notepad.exe:
=[0m message...[K
|[0m message...[K
][0m message...[K
-[0m message...[K
=[0m message...[K
|[0m message...[K
][0m message...[K
From notepad++:
Copied from terminal:
[K[?25hmessage...
Is there any way to fix this behavior? Can I init yaspin class with some specific values to make it work or smth?
(Please note for debugging purposes I used custom very simple spinner: =|]-
)
Hello @mzylowski
Thanks for reporting this!
Yaspin is not targeted for Windows and was never tested under the windows OS. I'd suggest to use halo spinner. It should support both Unix-like and Windows environment.
Could you perhaps add a note to the README about the target platforms? I also assumed that this library would work in Windows cmd, and found this Issue after the ANSI escape codes were getting printed to the screen.
Anyone else in my boat who would like to get this working in Windows, try here and here for potential workarounds.
@thouseweart I believe it is possible to add support for Windows-compatible escape codes. Let me investigate this. I'll reopen the issue.