Open erikgeiser opened 2 years ago
Making this change will slightly alter the final output of some programs, however it will remove a quirk which we've seen confuse new users.
The former behavior can basically be recreated via some additional logic in View()
, which is where such rendering logic should be anyway.
Here are some illustrations of the current behavior:
Normal view. The help text resides on the final line.
[x] UI
[ ] More UI
Some help text
After quit. The developer is exploiting a quirk in which the final view doesn't contain a newline, so the help text prints over it on exit.
[x] UI
[ ] More UI
user@machine:~ $: _
As a new user, I just got bit by this behaviour! And I have to admit, it really stumped me for quite a few hours where I spent figuring out whether:
I eventually figured out an extra newline was needed and submitted an issue here: https://github.com/charmbracelet/bubbletea/issues/827.
I will definitely recommend updating the default behaviour (to print an extra newline) with an option to turn it off if needed.
As a new user, I just got bit by this behaviour! And I have to admit, it really stumped me for quite a few hours where I spent figuring out whether:
As a new user, and new to go in general I also assumed this is a mistake on my end, so same story as you. Would be nice if there was a note about this folks.
Is there still interest in this? I've made a proof of concept, but I'm open to changing the implementation.
If the final call to
View()
(after emittingtea.Quit
) does not end with a newline it is immediately overwritten by the shell prompt or by any other output. This can be a bit surprising and it's hard to debug if you don't know what happens.It can be avoided by appending a newline to the result of the final call to
View()
if this result is not empty.