Skip to content

feat(ui): add cursor blink support#620

Merged
Wirasm merged 2 commits intomainfrom
kild/feat-cursor-blink
Feb 28, 2026
Merged

feat(ui): add cursor blink support#620
Wirasm merged 2 commits intomainfrom
kild/feat-cursor-blink

Conversation

@Wirasm
Copy link
Owner

@Wirasm Wirasm commented Feb 28, 2026

Summary

  • Add BlinkManager with epoch-based timer to toggle cursor visibility every 500ms
  • Pause blink on keystroke so cursor stays visible during typing
  • Unfocused terminals show a static hollow block (no blinking)

Test plan

  • Open kild-ui, verify cursor blinks at ~500ms intervals when idle
  • Type in terminal, confirm cursor stays solid during input and resumes blinking after pause
  • Switch focus away from terminal, verify cursor becomes a static hollow block
  • Open multiple terminals, confirm each has independent blink state

Closes #471

Add epoch-based cursor blink timer to TerminalView. The BlinkManager
toggles cursor visibility every 500ms via cx.spawn(), with epoch tracking
to cancel stale timers when a new cycle starts.

Cursor stays visible during typing — pause() on every keystroke resets
the blink timer. Unfocused terminals show a static hollow block cursor
(no blinking).

Closes #471
- Stop blink timer on focus loss, restart on focus gain — no more
  wasteful repaints on unfocused terminals, and cursor state is
  always reset when focus returns (even via mouse click)
- Replace .unwrap_or(false) with explicit match on view update —
  view-released teardown is now a distinct code path, not silently
  collapsed with stale-epoch exits
- Encapsulate toggle logic behind toggle_if_current() method —
  blink field stays pub(super) for the spawn closure but mutation
  is self-contained
- Rename pause() to reset() — matches actual semantics (restarts
  the blink cycle, not a pause)
- Remove two-step new() + enable() — blink starts inert, render()
  drives the lifecycle based on focus state
- Tighten module visibility: pub mod blink → mod blink
- Fix doc comments for accuracy
@Wirasm Wirasm merged commit 58bdf36 into main Feb 28, 2026
6 checks passed
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.

feat: add cursor blink support with BlinkManager

1 participant