Skip to content

[POC] Blinking text (SGR 5/25) in kitty #8551

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ctrlcctrlv
Copy link
Contributor

Closes #540.

This PR is not yet ready to be merged, and may never be depending on @kovidgoyal's feedback given his skepticism in the original issue (and my own, to be fair); critically, I have not made it optional yet.

I wrote this for my own personal use. Because most TE's ironically ignore SGR 5/25 due to its lack of support, I knew I could rely on it to really draw my attention in scripts, without giving reallt any other application the ability to blink as there's no check for it.

I wanted to just leave this patch in #540. But, I couldn't comment, despite having contributed PR's in past. Kovid said over email to post this PR as an alternative.

2025-04-20_04-08-24.remuxed.mp4

Closes kovidgoyal#540.

This PR is not yet ready to be merged, and may never be depending on
@kovidgoyal's feedback given his skepticism in the original issue (and
my own, to be fair); critically, I have not made it optional yet.

I wrote this for my own personal use. Because most TE's ironically
ignore SGR 5/25 due to its lack of support, I knew I could rely on it to
really draw my attention in scripts, without giving reallt any other
application the ability to blink as there's no check for it.

I wanted to just leave this patch in kovidgoyal#540. But, I
couldn't comment, despite having contributed PR's in past. Kovid said
over email to post this PR as an alternative.
@kovidgoyal
Copy link
Owner

See the discussion in #8315

With regards to your implementation, I dont allow branches in kitty shaders. The way to implement this would be basically to use cursor_opacity to control the foreground opacity of text using mix() and step() in the shader. This suffers from the issue that blinking text will stop blinking when the cursor stops blinking, but it is the only reasonable way to implement this.

Drawing attention to things in scripts is best done with reverse video not blink. Or even using the marker feature in kitty.

I still dont see any actual use case for blink and given it cannot be implemented in a non-hacky way, I am not inclined to add support for it.

@ctrlcctrlv
Copy link
Contributor Author

Wouldn't this mean if the cursor blinking is disabled, text would not blink?

@kovidgoyal
Copy link
Owner

kovidgoyal commented Apr 21, 2025 via email

@ctrlcctrlv
Copy link
Contributor Author

Oh, I see your meaning now. I'll amend my patch.

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.

Support blinking text
2 participants