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

ansi: Add support blinking text #5217

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thecharlesjenkins
Copy link

@thecharlesjenkins thecharlesjenkins commented Jan 19, 2025

Add support for the blinking text ansi character. Both "slow" (code 5) and "fast" (code 6) blink at the same interval as the cursor, as it seems implementations often do this.

Blinking of text stops when the screen loses focus, same as the cursor. To keep blinking of text and cursor in sync, typing a character no longer resets the cursor blinking timer. Instead of reseting the timer, the cursor is immediately set to visible and will stay visible for at least the length of one interval to ensure that blinking does not happen while the user is actively typing. This has the side-effect that at startup, it takes two intervals until the first cursor blink happens when ghostty is launched.

Also introduce a config "blink-interval" which can set the blinking speed of the cursor and text to an arbitrary time. This config code was originally written by @pluiedev.

Discussion in: #4258 (comment)

Add support for the blinking text ansi character. Both "slow" (code 5)
and "fast" (code 6) blink at the same interval as the cursor, as it
seems implementations often do this.

Blinking of text stops when the screen loses focus, same as the cursor.
To keep blinking of text and cursor in sync, typing a character no
longer resets the cursor blinking timer. Instead of reseting the timer,
the cursor is immediately set to visible and will stay visible for at
least the length of one interval. This has the side-effect that at
startup, it takes two intervals until the first cursor blink happens.
The interval at which text and cursor blink can now be configured by
setting "blink-interval" to an arbitrary time.

Code originally written by @pluiedev and adapted for this patch.

Signed-off-by: Charlie Jenkins <[email protected]>
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.

1 participant