Code Monkey home page Code Monkey logo

Comments (7)

muesli avatar muesli commented on June 14, 2024

You need to wrap your content at the given maximum width.

from bubbletea.

Horryportier avatar Horryportier commented on June 14, 2024

#43 looked at this issue and added wrapping using github.com/muesli/reflow/wordwrap package yet it still has that weird despairing bug although text appears when i add long enough string so wordwrap triggers and then all seems to stay on screen from that point on

from bubbletea.

m1cm1c avatar m1cm1c commented on June 14, 2024

#43 looked at this issue and added wrapping using github.com/muesli/reflow/wordwrap package yet it still has that weird despairing bug although text appears when i add long enough string so wordwrap triggers and then all seems to stay on screen from that point on

I'm experiencing this exact bug. I thought about calling

import (
	"github.com/inancgumus/screen"
)

func clearScreen() {
	screen.Clear()
	screen.MoveTopLeft()
}

in the beginning of View() but https://pkg.go.dev/github.com/charmbracelet/bubbletea#ClearScreen states: "Note that it should never be necessary to call ClearScreen() for regular redraws." So I think there must be a better way to fix this. Did you figure something out by now?

from bubbletea.

meowgorithm avatar meowgorithm commented on June 14, 2024

Hi! @Horryportier or @m1cm1c: can you produce a minimal example, with reflow, that reproduces the issue? That will help us solve this quickly and effectively. If the bug you're seeing is in reflow itself, let's close this issue and open an issue there.

from bubbletea.

Horryportier avatar Horryportier commented on June 14, 2024

I don't thing reflowis the issue, bug was present before I've added that library. Wordwrap solved issue partially because it still would occurred for strings shorter that wrap threshold but it would fix itself after wordwrap was triggered

As for reproducing the bug it would hard because it only occurs for me when dealing with text data from serial port. So there might be issue with data send from esp32 having some weird glyphs. Although arduino ide 2 works just fine.

from bubbletea.

m1cm1c avatar m1cm1c commented on June 14, 2024

@meowgorithm Here is a fairly small program that reliably reproduces the described behavior: https://gist.github.com/m1cm1c/0248ef748db56d0cc1f7e4398a3f2fad

I ran it via: go run .

Initial state (looks fine):
image

After making the window wider (looks fine):
image

After making the window narrower again, "(esc to quit)" repeats:
image

OS: Manjaro
Go version: 1.21.7
Architecture: AMD64
Terminal: xfce4-terminal (version 1.1.3)
Shell: GNU bash (version 5.2.26(1))

from bubbletea.

Horryportier avatar Horryportier commented on June 14, 2024

that looks like different bug than mine mine makes first few characters disappear corresponding to amount of additional text
image
image
image

from bubbletea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.