Conversation
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
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
BlinkManagerwith epoch-based timer to toggle cursor visibility every 500msTest plan
Closes #471