charmbracelet / bubbletea

A powerful little TUI framework 🏗
MIT License
26.64k stars 769 forks source link

Inline: rendering artifacts when resizing window #717

Open StarpTech opened 1 year ago

StarpTech commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Setup Please complete the following information along with version numbers, if applicable.

To Reproduce Steps to reproduce the behavior:

  1. Run fancy-list example
  2. Resize the terminal multiple times to a very minimal height

Source Code Please include source code if needed to reproduce the behaviour.

Expected behavior The program should not repaint the program on multiple lines.

Screenshots Screencast_from_04-09-2023_034642_PM.webm

Additional context Replicated in Gnome Terminal, JetBrains In-built, VsCode

meowgorithm commented 1 year ago

Thanks for the report! This is a dup of #573—closing this one accordingly.

meowgorithm commented 1 year ago

Reopening per the discussion in #573 so we can track inline rendering separately from the altscreen efforts.

StarpTech commented 1 year ago

I'm curious, what's the difference between bubbletea inline render and clearing, drawing the text manually? I can't reproduce any visual bugs when printing and updating libpgloss text to stdout directly.

StarpTech commented 1 year ago

@meowgorithm friendly ping.

meowgorithm commented 1 year ago

I'm curious, what's the difference between bubbletea inline render and clearing, drawing the text manually? I can't reproduce any visual bugs when printing and updating libpgloss text to stdout directly.

Lip Gloss merely prints to the terminal and exits, whereas Bubble Tea manages the cursor and redraws when necessary. So when the terminal resizes Bubble Tea updates it’s renderer’s state and redraws, whereas text printed with Lip Gloss is unmanaged and remains solely in the jurisdiction of the terminal’s own renderer.