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

Cursor flicker appears in real-time (Windows) #2

Closed
mcay23 opened this issue Jun 19, 2020 · 11 comments
Closed

Cursor flicker appears in real-time (Windows) #2

mcay23 opened this issue Jun 19, 2020 · 11 comments

Comments

@mcay23
Copy link

mcay23 commented Jun 19, 2020

see : https://asciinema.org/a/KxW4FQuTg4bRPsbgML4AlJa57
Happens in real time.

Might be cleaner to rewrite the screen instead of clearing.

@thatcherclough
Copy link
Owner

okay first of all, that is a really cool animation. for testing purposes could you send it to me? also the problem with rewriting the screen is that if you have a frame that is 10 lines long and then the next frame is 9 lines long, the 10th line is still present when displaying the second frame. i will look into another fix, possibly making the cursor clear or something else!

@mcay23
Copy link
Author

mcay23 commented Jun 19, 2020

Here's the file
out.txt

From this repo BoardingSimulator

@thatcherclough
Copy link
Owner

Okay thanks! I will get right to work!

@thatcherclough
Copy link
Owner

Are you using a windows terminal or Linux terminal? You mentioned (Windows) in the title, however on asciinema it says it the OS is linux.

@mcay23
Copy link
Author

mcay23 commented Jun 19, 2020

I am using windows. Asciinema doesn't work with windows so I ran it through WSL to record the terminal. To clarify, I'm seeing the flickering both on windows and WSL.

Here's a screen recording of the issue in windows: link

@thatcherclough
Copy link
Owner

Alright, so I see the flickering on Windows, and because WSL runs from a windows terminal, it would make sense that the flickering is still present when running through WSL. I will work on finding a solution now!

@thatcherclough
Copy link
Owner

So here is what I have gathered after testing:

  1. The flickering is because of the Windows terminal. When running the same command on my Mac computer, there is zero flickering.
  2. The speed at which the windows terminal prints is slower than the speed at which the Mac terminal prints. I ran the same command on both a windows and mac computer at the same time, and the mac computer finished about 5 seconds earlier (You could increase the fps on the windows machine to fix this).
  3. Removing the code that clears the screen dramatically reduces the flickering of the animation.

In order to fix the flickering, I added an option to specify if you want to clear the screen after every frame. From my experience, this removes the flickering of the animation, however it does not remove the flickering of the cursor. To fix the cursor flickering, you can go to the terminal properties and set the cursor to black.

Here is an updated JAR file. Can you test it with the argument -c set to false? thanks!

@mcay23
Copy link
Author

mcay23 commented Jun 20, 2020

Hi, I tested the new jar. It seems like setting -c to false or true doesn't change the flickering on windows, both outputs look identical to me. Thanks.

@thatcherclough
Copy link
Owner

Huh that’s weird. it fixed it on my windows machine. i will look into it more tomorrow!

@thatcherclough
Copy link
Owner

After further testing and research, the flickering is happening because of the Windows terminal, not AsciiAnimator. The only setting that I could find that effected the flickering was "legacy mode". Disabling this mode seemed to reduce the flickering when compared to when it was enabled. Because this problem is with windows terminal, not AsciiAnimator, I will be closing this issue. I have just released AsciiAnimator 1.1.0 that adds the -c option which stopped the flickering for me.

@mcay23
Copy link
Author

mcay23 commented Jun 22, 2020

Just wanted to let you know I got it to work. Looks like I was mixing up the .jar files, my bad. Works brilliantly now. Thanks a lot!

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

No branches or pull requests

2 participants