v0.13.4 introduced a regression where lines weren't always cleared when
resizing the window resulting in the presence of rendering artifacts.
This commit fixes that.
If the number of lines increased there's a chance that the increase in
lines caused the terminal to scroll (even in the altscreen). Because of
this we must repaint everything, as skipping lines will mis-render.
Thanks to @fiws for reporting this bug.
The golang.org/x/crypto/ssh/terminal package is deprecated and merely a
wrapper around golang.org/x/term. Use the latter directly and avoid the
dependency on the former altogether.
* Add commands EnterAltScreen and ExitAltScreen for toggling the altscreen
* Add altscreen toggling example
* ignore .idea
Co-authored-by: Christian Rocha <christian@rocha.is>
The Nil Renderer essentially disables the Bubble Tea renderer sending
loggings and print statements to stdout. It can be enabled via the
ProgramOption WithoutRenderer.
Fix race by acquiring the mutex before accessing renderer.buf in flush.
WARNING: DATA RACE
Read at 0x00c0000ee0a0 by goroutine 11:
bytes.(*Buffer).Len()
/home/chlunde/opt/go/src/bytes/buffer.go:73 +0x64
github.com/charmbracelet/bubbletea.(*renderer).flush()
/home/chlunde/src/bubbletea/renderer.go:91 +0x45
github.com/charmbracelet/bubbletea.(*renderer).listen()
/home/chlunde/src/bubbletea/renderer.go:76 +0x185
Previous write at 0x00c0000ee0a0 by main goroutine:
bytes.(*Buffer).Reset()
/home/chlunde/opt/go/src/bytes/buffer.go:98 +0xf5
github.com/charmbracelet/bubbletea.(*renderer).write()
/home/chlunde/src/bubbletea/renderer.go:195 +0x13c
github.com/charmbracelet/bubbletea.(*Program).Start()
/home/chlunde/src/bubbletea/tea.go:330 +0xbbb
main.main()
/home/chlunde/src/bubbletea/examples/spinner/main.go:27 +0x229
Fixes#54