Skip to content

fix(renderer): avoid blanking popups before painting content - #226

Draft
jiunbae wants to merge 2 commits into
Helvesec:mainfrom
jiunbae:fix/popup-flicker
Draft

jiunbae wants to merge 2 commits into
Helvesec:mainfrom
jiunbae:fix/popup-flicker

Conversation

@jiunbae

@jiunbae jiunbae commented Sep 9, 2026

Copy link
Copy Markdown

Problem and change

An updating display-popup currently paints a rectangle of spaces before repainting its content. Even a tiny TUI update therefore emits a complete blank popup followed by the actual rows. Terminals consuming the output incrementally (including over PTYs/SSH) can show that intermediate blank surface as a flash.

Render each popup content row directly in its final state instead. Surface rows are padded after their content, using the popup style and the existing ANSI/grapheme-aware truncator, so shorter/missing rows still erase stale cells. Static formatted text uses its existing fixed-width renderer for every row. Borders and process SGR remain supported.

Related to #216, but this does not fix its per-read-chunk refresh/backpressure issue or introduce incremental/delta popup frames. Host status ticks overwriting an open popup are reported separately in #225.

Validation

  • Regression tests check that a filled borderless popup has no all-blank prepaint and each row is positioned once.

  • A screen-model test verifies that short Unicode/combining-character content and missing rows clear old text.

  • Existing overlay tests cover SGR, literal format-like process output, clipping, row bounds, border variants, and static text.

  • Linux x86_64, isolated 120x30 PTY clients, status disabled: six seconds of the same idle muxa watch popup emitted 57,624 bytes / 180 full-width blank runs with stock rmux 0.10.0, versus 32,298 bytes / 0 full-width blank runs with this patch. This measures removal of the blank phase; it is not a claim that all sources of terminal flicker or overlay backlog are fixed.

  • cargo build --workspace: passed.

  • cargo clippy --workspace --all-targets -- -D warnings: passed.

  • cargo fmt --all -- --check: passed.

  • cargo test -p rmux-server --lib renderer::overlay: 16 passed.

  • cargo test --workspace --all-targets: stopped at the unchanged rmux_manpage_renders_with_system_formatter test. This Linux environment has Ubuntu's minimized-system /usr/bin/man stub, which returns success with a notice instead of rendering the page; the test consequently cannot find RMUX. No changes were made to that test or the manpage.

  • The broader run SHELL=/bin/sh cargo test --workspace --all-targets --no-fail-fast -- --skip rmux_manpage_renders_with_system_formatter completed but was not green. Besides shell-name expectations and an unselected local Ruby version, it found a changelog release-heading violation (fixed in the follow-up commit), an attach redraw failure, and a server test process stack overflow.

  • With SHELL=/bin/bash RBENV_VERSION=3.1.1, all four affected CLI/release test targets passed on rerun: cli_attach_flow (40), cli_window_surface (134), release_downstream_writer_spec (6), and release_gate_python_floor_spec (3).

  • The server library rerun with SHELL=/bin/bash RBENV_VERSION=3.1.1 RUST_MIN_STACK=16777216 cargo test -p rmux-server --lib completed: 4,075 passed, 5 failed, 3 ignored. The failures are timed_out_attach_generation_cannot_consume_healthy_fallback_queries, display_message_expiry_preserves_an_open_bracketed_paste_boundary, managed_client_actions_fail_closed_when_a_pid_is_reregistered, rename_session_serializes_timer_rekey_before_source_name_reuse, and live_attach_clock_mode_reroutes_complete_bracketed_paste. These failures have not been compared against an unmodified upstream checkout, so this PR does not assert they are baseline failures.

This PR remains draft because whole-workspace validation is not green, although the popup regression tests and the isolated PTY comparison pass. The user's running rmux daemon was not replaced or restarted.

Signed-off-by: Jiun Bae <jiunbae.623@gmail.com>
Signed-off-by: Jiun Bae <jiunbae.623@gmail.com>
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