Add blinking cursor support#434
Merged
Merged
Conversation
Honor the terminal's DECSCUSR blink request (mode 12), which the renderer previously dropped. The renderer forwards `render_state.cursor.blinking' as the buffer-local `ghostel--cursor-blinking', and a per-buffer timer blinks the cursor via `internal-show-cursor' (the primitive Emacs's own `blink-cursor-mode' uses) for the bar, block, and underline shapes. The blink yields to a globally-enabled `blink-cursor-mode' to avoid a double beat, and only runs on graphical frames. `internal-show-cursor' sets a per-window flag, so a window the blink left in its "off" phase would hide the next buffer's cursor. The blinked window is restored both when the blink stops and on `window-buffer-change-functions' (deferred out of redisplay, where `internal-show-cursor' is inert). Both hooks are installed only while actively blinking and removed on stop. evil-ghostel ends any terminal-driven blink when evil reclaims the cursor on leaving the alt-screen. README/CHANGELOG updated; the feature comparison now splits cursor shapes from blink support.
dakra
force-pushed
the
cursor-blink
branch
2 times, most recently
from
June 20, 2026 20:43
d7013e4 to
a551781
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds blinking cursor support — the one cursor capability ghostel was missing versus eat. ghostty's VT engine already computes the blink state (DECSCUSR mode 12), but the renderer was dropping it; now a terminal app that requests a blinking bar/block/underline actually blinks in the Emacs buffer instead of rendering steady.
How it works
render_state.cursor.blinkingto the buffer-localghostel--cursor-blinking(threaded likeghostel--cursor-pos, soghostel--set-cursor-stylekeeps its 2-arg signature — no churn for evil-ghostel's advice or existing tests).internal-show-cursor— the same cheap primitive Emacs's ownblink-cursor-modeuses (noredraw-frame, unlike eat).blink-cursor-modeto avoid a double beat, and only runs on graphical frames.Window-leak fix
internal-show-cursorsets a per-window "cursor off" flag, so a window the blink left mid-"off" would hide the cursor of whatever buffer it showed next (e.g. split the terminal's window, switch it to*scratch*→ no cursor). The blinked window is restored both when the blink stops and onwindow-buffer-change-functions— deferred viarun-at-time 0becauseinternal-show-cursoris inert during redisplay, which is when those functions run. Both hooks are installed only while actively blinking and removed on stop (no per-command hooks).Other
Testing
ghostel-test-cursor-blink(timer start/stop + hook install/removal).\e[5 qstarts a real toggling blink,\e[2 qgoes steady, copy mode cancels it, andC-x b *scratch*from the blinked window leaves the cursor visible (the leak fix).make -j8 allgreen.