yaspin icon indicating copy to clipboard operation
yaspin copied to clipboard

Strange spinner behavior in windows terminal

Open mzylowski opened this issue 6 years ago • 3 comments

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++: image

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: =|]-)

mzylowski avatar Nov 16 '18 11:11 mzylowski

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.

pavdmyt avatar Nov 16 '18 13:11 pavdmyt

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 avatar Feb 24 '21 23:02 thouseweart

@thouseweart I believe it is possible to add support for Windows-compatible escape codes. Let me investigate this. I'll reopen the issue.

pavdmyt avatar Feb 26 '21 09:02 pavdmyt