Fix TUI flickering by removing tea.ClearScreen on navigation events#7
Open
Fix TUI flickering by removing tea.ClearScreen on navigation events#7
Conversation
… height Remove all tea.ClearScreen commands that were returned on every navigation key press and scroll wheel event. Bubbletea's built-in diff-based renderer efficiently updates only changed lines without clearing the screen. The ClearScreen calls were forcing full terminal redraws on every cursor movement, causing significant visible flicker. Also add defensive height padding/clamping in View() to ensure the rendered output always has exactly m.height lines, preventing any rendering drift that could cause artifacts with the diff renderer. Remove the now-unused isNavigationKey helper function. Agent-Logs-Url: https://github.com/UnitVectorY-Labs/goauthorllm/sessions/7366f989-34c8-46bc-8ae1-54a1ba2486b0 Co-authored-by: JaredHatfield <208119+JaredHatfield@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
JaredHatfield
April 12, 2026 19:10
View session
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.
Every arrow key press, scroll wheel tick, and page up/down returned
tea.ClearScreen, forcing a full terminal wipe and redraw. Bubbletea's renderer already diffsView()output and updates only changed lines —ClearScreenbypasses this entirely.Changes
tea.ClearScreenreturns acrosshandleMouse,handleKey, andupdateWorkspaceInputs— scroll wheel, raw wheel direction, navigation keys, and page up/down all now returnnilor the textarea's own commandView()output to exactlym.heightlines — pad short frames, trim long ones, so the diff renderer always compares equal-height frames with no drift artifactsisNavigationKeyhelper — only existed to gate theClearScreenlogicBefore
After