Skip to content

Conversation

@Nutzzz
Copy link
Contributor

@Nutzzz Nutzzz commented May 9, 2025

Fixes #15

No more flicker during animation!

For Windows Terminal support, this currently requires a Canary nightly build.

The only issue that I see right now is that the cursor dances a bit (see video). I'm sure it's something simple; I haven't looked into it yet. I'll mark this as draft until that's fixed; but perhaps it can be moot since the cursor flickering has always been an issue: should we just turn off the cursor when animating and turn it back on again after?
Hide: CSI ?25l
Show: CSI ?25h.

EDIT: And I guess we might swap the reverse /t only if Synchronized output is supported...?
EDIT 2: Note this video is the elephant APNG; the elephant GIF still has the transparent eye issue in #24 .

Elephant.no.flicker.mp4

@Nutzzz
Copy link
Contributor Author

Nutzzz commented May 13, 2025

OK, I fixed the cursor "dancing" during animation with sync enabled by changing to Console.Write() instead of WriteLine(), but went ahead and hid the cursor anyway, and then the cursor show is a WriteLine().

Animations look so much better without the cursor, but using Ctrl+C does result in the cursor not being re-enabled. With WT at least, simply typing a letter makes it reappear. But I'm a little bit torn about using it because of the effect on other terminals. Depending on which one, it looks like there are a variety of tricks people might use to get it back, but I can imagine it might be an annoying experience. But it's so easy not to use Ctrl+C when the prompt is right in front of you. What do you think?

EDIT: Wait, the hide should go in the example, not the library. Then it's much less of an issue....

@Nutzzz Nutzzz marked this pull request as ready for review May 13, 2025 17:23
@teramako
Copy link
Owner

OK, I fixed the cursor "dancing" during animation with sync enabled by changing to Console.Write() instead of WriteLine(), but went ahead and hid the cursor anyway, and then the cursor show is a WriteLine().

Animations look so much better without the cursor, but using Ctrl+C does result in the cursor not being re-enabled. With WT at least, simply typing a letter makes it reappear. But I'm a little bit torn about using it because of the effect on other terminals. Depending on which one, it looks like there are a variety of tricks people might use to get it back, but I can imagine it might be an annoying experience. But it's so easy not to use Ctrl+C when the prompt is right in front of you. What do you think?

EDIT: Wait, the hide should go in the example, not the library. Then it's much less of an issue....

Yes, the cursor dancing behavior is indeed a concern.
I once tried to put code in the library to make the cursor disappear, but I stopped immediately.
I agree with posting a way to remove the cursor in the example program and not in the library.

Copy link
Owner

@teramako teramako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! This is a nice feature.

@teramako teramako merged commit 2ad6aa7 into teramako:main May 14, 2025
1 check passed
@Nutzzz Nutzzz deleted the sync branch May 14, 2025 19:26
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

Successfully merging this pull request may close these issues.

Use Synchronized Updates when clearing frames

2 participants