Skip to content

Keep queued TUI input responsive and make Ctrl-C global - #152

Merged
lance0 merged 4 commits into
masterfrom
fix/tui-input-responsiveness
Oct 16, 2026
Merged

lance0 merged 4 commits into
masterfrom
fix/tui-input-responsiveness

Conversation

@lance0

@lance0 lance0 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

A burst of navigation keys makes pause and quit wait behind one 16 ms sleep per key. Modal handlers also consume Ctrl-C before the quit handler sees it.

Wake the UI directly from a bounded asynchronous event channel, process queued input independently of the frame interval, and keep redraws capped at the existing ~60 fps. Cancellation wakes an idle UI immediately, Ctrl-C/ETX quits from every overlay, and the input thread exits when its receiver closes. Target-list refreshes retain frame-based pacing.

Stacked on #151. This separates input latency from Ratatui's immediate-mode rendering cadence: https://ratatui.rs/concepts/rendering/.

Validation: full build/test/clippy/fmt/doc checks and Rust 1.88 all-target check. Added event-loop regressions for 80 queued keys, redraw throttling, idle cancellation and both Ctrl-C encodings across all overlays. Release-build local PTY audit on Apple M1 Pro/macOS 15.0.1 (Crossterm output; excludes terminal-emulator painting): single-key p95 34.23 → 14.36 ms; pause behind 80 navigation keys 1668.31 → 20.02 ms; no output during two idle seconds. Ctrl-C in Settings now exits.

lance0 and others added 4 commits October 16, 2026 11:50
PgUp/PgDn in help moved a fixed 10 rows, so on short terminals the rows
between pages were unreachable; page by the popup's visible height as hop
details now do. The mid-width status hints were chosen by a fixed 60-column
threshold that ignored the "? help" prefix and clipped "Enter details";
fall back to the short hints whenever the full set would not fit.
@lance0
lance0 force-pushed the fix/responsive-tui-layouts branch from 19f2404 to 58d364b Compare October 16, 2026 15:53
@lance0
lance0 force-pushed the fix/tui-input-responsiveness branch from a527ce3 to 8419976 Compare October 16, 2026 15:53
@lance0
lance0 changed the base branch from fix/responsive-tui-layouts to master October 16, 2026 15:58
@lance0
lance0 marked this pull request as ready for review October 16, 2026 15:59
@lance0
lance0 merged commit b9966da into master Oct 16, 2026
7 checks passed
@lance0
lance0 deleted the fix/tui-input-responsiveness branch October 16, 2026 16:13
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