preview-tui: clear sixel graphics when switching previews - #2152
Draft
JWWTSL wants to merge 1 commit into
Draft
Conversation
When using sixel-based image previewers (img2sixel, chafa, timg), switching between files causes previews to stack on top of each other because the terminal clear command only clears the text layer, not the sixel graphics layer. Send DECSDM reset (\033[?8015l) followed by re-enable (\033[?8015h) to clear sixel graphics before rendering a new preview, matching the existing cleanup pattern for kitty icat and ueberzug. Fixes jarun#2134
Owner
|
Why is this in draft state? |
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
preview-tui, fixing the issue where img2sixel/chafa/timg previews stack on top of each other in tmuxChanges
plugins/preview-tui\033[?8015l/\033[?8015h) inpreview_fifo()andwinch_handler()to clear sixel graphics before rendering new previewsRoot Cause
The existing cleanup in
preview_fifo()handles kitty icat (kitty +kitten icat --clear) and ueberzug (ueberzug_remove), but has no equivalent for sixel-based image previewers. The terminalclearcommand only clears the text layer, leaving sixel graphics from the previous preview visible.This follows the same pattern established in PR #2116 which added kitty graphics cleanup.
Test Plan
shellcheckpasses on modified pluginNNN_PREVIEWIMGPROG=img2sixel, open nnn withpreview-tuiin tmux, navigate between image files and verify previous preview is clearedchafaas previewerFixes #2134