fix(renderer): use view height before first flush - #1766
Open
fzlzjerry wants to merge 2 commits into
Open
Conversation
andrinoff
approved these changes
Aug 14, 2026
andrinoff
left a comment
Member
There was a problem hiding this comment.
Thank you for your contribution!, please fix the comment below! Nice catch!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1766 +/- ##
==========================================
+ Coverage 56.50% 58.46% +1.96%
==========================================
Files 25 25
Lines 1315 1317 +2
==========================================
+ Hits 743 770 +27
+ Misses 482 453 -29
- Partials 90 94 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
andrinoff
self-requested a review
August 14, 2026 07:46
andrinoff
requested changes
Aug 14, 2026
andrinoff
left a comment
Member
There was a problem hiding this comment.
sorry, meant to request changes
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.
Fixes #1740.
Before
Create an 80x24 renderer, render a one-line inline view, and call
insertAbovebefore the first flush. The cell buffer still has the terminal height at that point, so the renderer emitsESC[24Band scrolls the viewport.After
Before the first inline flush,
insertAbovecalculates its cursor movement from the current view height. Once a view has been flushed, it continues using the cell buffer height so the cursor math stays tied to what is actually on screen. Alt-screen behavior is unchanged.The regression test exercises the pre-flush call order directly and verifies the complete output sequence for a one-line view.
Tests
go test ./...go test -race -count 4 -cpu 1,4 ./...golangci-lint runI have read
CONTRIBUTING.md.I have created a discussion that was approved by a maintainer (not applicable: this is a bug fix for [v2] tea.Printf/Println before the first flush emits a full-terminal-height cursor-down (scrolls the whole screen) #1740).