yaspin
yaspin copied to clipboard
Long messages or messages with new line char print on every line for each frame
Thanks for this fun lib. I noticed messages will be repeated if any of the below triggers are encountered.
[notes] version = 1.5.0 machine = mac (catalina)
[triggers]
- very long message (longer than buffer width ie resized window)
- messages with '\n' (new line character)
[screenshot]
Hi @cchaffatt
The behavior triggered by \n
symbol is kind of expected. Yaspin tries to avoid interfering with user input, otherwise handling all possible terminal escape sequences would make code much more complicated. It is expected that yaspin receives sanitized text.
The case with long messages is interesting, I'll investigate that.
Thanks for reporting this!
I have the same issue! Especially when I'm getting eager and drop a lot of status info in sp.text
I pretty much get the picture above. What we could do here is figure out what the current terminal width is and then either crop or marquee the current text status.
One option that would apparently also be more or less platform independent would be shutil.get_terminal_size()
. Cropping terminal output would increase the user experience already, but having the text as a marquee banner would be really nice, as everything would be visible then.