Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange spinner behavior in windows terminal #24

Open
mzylowski opened this issue Nov 16, 2018 · 4 comments
Open

Strange spinner behavior in windows terminal #24

mzylowski opened this issue Nov 16, 2018 · 4 comments
Labels

Comments

@mzylowski
Copy link

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

@pavdmyt
Copy link
Owner

pavdmyt commented Nov 16, 2018

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.

@thouseweart
Copy link

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.

@pavdmyt
Copy link
Owner

pavdmyt commented Feb 26, 2021

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

@pavdmyt pavdmyt reopened this Feb 26, 2021
@d-chris
Copy link

d-chris commented Oct 22, 2024

@mzylowski if you want to use halo on windows you are also limited to "line" spinner

@pavdmyt issue is the codepage cp850 of the terminal, which on windows dated back to ms-dos times.

i tried to contribute to py-spinners / halo and support all spinner with cp850 encoding. PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants