Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long messages or messages with new line char print on every line for each frame #131

Open
cchaffatt opened this issue May 11, 2021 · 2 comments

Comments

@cchaffatt
Copy link

cchaffatt commented May 11, 2021

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]
Screen Shot 2021-05-11 at 6 42 14 PM

@pavdmyt
Copy link
Owner

pavdmyt commented May 16, 2021

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!

@sebageek
Copy link
Contributor

sebageek commented Jun 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants