Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pager example with high performance rendering loses first line on resize #1039

Open
leg100 opened this issue Jun 11, 2024 · 3 comments
Open

Comments

@leg100
Copy link
Contributor

leg100 commented Jun 11, 2024

Describe the bug
I'm running the pager example, albeit with high performance rendering turned on. It works fine until the window is resized, at which point the first line of the viewport is 'lost', i.e. it is re-rendered as an empty line.

Setup

  • Arch
  • Bash
  • Alacritty

To Reproduce
Steps to reproduce the behavior:

  1. go to ./examples/pager
  2. edit main.go to enable high performance renderer:
index 12a71a3..fd677d5 100644
--- a/examples/pager/main.go
+++ b/examples/pager/main.go
@@ -19,7 +19,7 @@ import (
 // Also keep in mind that high performance rendering only works for programs
 // that use the full size of the terminal. We're enabling that below with
 // tea.EnterAltScreen().
-const useHighPerformanceRenderer = false
+const useHighPerformanceRenderer = true
  1. run: go run main.go
  2. resize terminal window

Screenshots
Before resize:

image
After resize:

image

Further info

The line does reappear if you scroll down and then back up again.

It also re-appears if you full screen the terminal and then un-fullscreen the terminal.

If you scroll down before a window resize, and then resize the window, then the first visible line is missing and stays missing until you scroll it out of view and back into view.

@meowgorithm
Copy link
Member

Noted, thank you! This is a regression which we're tracking in #573.

@meowgorithm
Copy link
Member

Whoops, that's actually not the correct issue so let's track it here.

We'll look into this, however we're also working on a new renderer, which should obviate (and deprecate) the need for the current high performance rendering API, implicitly fixing this issue.

Anyway, we'll keep this issue updated.

@meowgorithm meowgorithm reopened this Jun 12, 2024
@leg100
Copy link
Contributor Author

leg100 commented Jun 12, 2024

Thank you @meowgorithm for the fast response.

To be honest I've been hitting this issue in my app. I've attempted for the last few days to incorporate high performance rendering, after seeing some very noticeable lag when rendering not-that-complicated nor very many ansi sequences. Because the app is multi-model, i.e. switching from one viewport to another one occupying the same lines on the terminal, it took some work to re-sync the viewport each time, but I got that working quite nicely. However every now and then the rendering would produce strange artefacts, with this issue being the one that was consistently replicable in the pager example.

With that in mind, I look forward keenly to the new renderer!

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

No branches or pull requests

2 participants