Skip to content

fix: skip full-screen clear in fullscreen mode to prevent flicker#192

Closed
fuleinist wants to merge 1 commit into
ccbrown:mainfrom
fuleinist:fix/fullscreen-clear-no-flicker
Closed

fix: skip full-screen clear in fullscreen mode to prevent flicker#192
fuleinist wants to merge 1 commit into
ccbrown:mainfrom
fuleinist:fix/fullscreen-clear-no-flicker

Conversation

@fuleinist
Copy link
Copy Markdown

When using element.fullscreen(), rapid state changes which fire TUI updates cause visible flicker at the bottom of the terminal. The flicker ranges from a few rows to more than half the screen, and always affects the bottom portion. The issue is apparent in applications with dense per-cell styling (background colors, multiple text styles per row) and complex web of UI components/elements.

Observed on Konsole 25.04.2 (Wayland). The terminal supports DEC mode 2026 (synchronized output), but the flicker occurs regardless — the volume of ANSI data between clear and rewrite appears to exceed what synchronized output can atomically batch.

Since write_canvas() overwrites every row and each row already emits CSI K (erase to end of line), the full-screen clear is redundant. This fix adds an explicit early-return path for fullscreen mode that only repositions the cursor to (0,0), skipping both clear_canvas_inline and the full terminal clear.

The non-fullscreen (inline) path is unchanged — it still needs the clear to handle variable-height output correctly.

Fixes #190

In fullscreen mode, write_canvas() already overwrites every row and
emits CSI K (erase to end of line) for each row. The full clear was
redundant and caused visible flicker on rapid state changes with dense
per-cell styling.

This matches the approach described in PR ccbrown#190 from djordjeglbvc.

Fixes: ccbrown#190
Copy link
Copy Markdown
Owner

@ccbrown ccbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

The change is the same as in #190. See my comment there about a regression that this introduces.

@ccbrown
Copy link
Copy Markdown
Owner

ccbrown commented May 9, 2026

#179 resolves this. Thanks anyway!

@ccbrown ccbrown closed this May 9, 2026
@fuleinist fuleinist deleted the fix/fullscreen-clear-no-flicker branch May 9, 2026 09:33
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.

2 participants