ryukinix / mal

MAL: A MyAnimeList Command Line Interface [BROKEN: BLAME MyAnimeList]
https://mal.readthedocs.io
Other
109 stars 9 forks source link

Option to disable "back and forth" animation on Windows #66

Closed ghost closed 6 years ago

ghost commented 6 years ago

In a default Windows command prompt, the fancy loading animation causes some nasty output due to the lack of proper support for symbols/colors in cmd. Powershell does the same thing. Here is an example of how it looks: ????????? ? matching animes - preparing animes ▄←[G←[K←[G←[KMatched 17 items:

Would it be possible to have a config option that would disable that animation?

Edit: It's obviously low-priority (as it is aesthetics) but I would be more than happy to write it myself and submit a pull request, if you wanted.

ryukinix commented 6 years ago

Yes, this is a known issue, but is not filled here on issue tracker. The main reason is because support on Windows was not a important thing on beginning. At first, I did need properly setup a way on decorating to easily disable the decorating animation without effort. After that we can create a flag to disable or just setup that on config file.

ryukinix commented 6 years ago

We even disable this for default on Windows... since I think this always the expected behavior (since doesn't works).

ryukinix commented 6 years ago

But you can record a simple gif of this behavior? If the problem is just the characters, maybe implementing this decorating/issue/30 here will take care of that using only ASCII code (not unicode as is using now). But if even the ANSI characters used to update the line is not working, we will need disable the animation totally.

To record a gif on windows I recommend GifCam.

ghost commented 6 years ago

I believe the animation would work on Windows if you use a third-party terminal, so a config option might be best rather than outright disabling it for Windows.

Here is what it looks like: Windows Animation

ryukinix commented 6 years ago

Thanks for the gif. The erase method seems not working very well too, but at least is not worse I executed before, which the animation will delete all your output of terminal (even C:\Window... and another thing that was printed before :v).

Yes, executing through cygwin or mingw will probably works, but not through the default Windows ancient terminal cmd.exe since is not a POSIX environment (I need to be POSIX), even the PowerShell. But see that running through environments like cygwin or mingw we will have different signatures of sys.platform, see here. So is safe disable to sys.platform == 'win32'.

ryukinix commented 6 years ago

Since I have released v0.6.1 of decorating library used for this back-forth animation, I can disable/enable this animation globally by:

import decorating
# to disable the animations
decorating.animated.enabled = False 
# to enable again
decorating.animated.enabled = True
ryukinix commented 6 years ago

~I'll create a flag for disable the animation for now as went requested. As further work, we can look about handle this better on Windows.~

EDIT: I'm thinking a little that would be nice have this behavior to be possible to setup on the config file as well because is too painful calling --disable-animation always

ryukinix commented 6 years ago

After #77 merged @logan-arens you can disable this option on the config file. Call mal config to get the path of file and a preview of how it looks.