tenox7 / ttyplot

a realtime plotting utility for terminal/console with data input from stdin
Apache License 2.0
1.13k stars 47 forks source link

[1.5.1] Minimum window size assumptions can be violated? #78

Closed hartwork closed 10 months ago

hartwork commented 1 year ago

Hi!

From a user point of view, resizing ttyplot's window to small sizes and back can get ttyplot into a broken state, e.g. see video below.

From a code point of view, there are multiple places where a certain minimum size is assumed…

…but not checked for. So the assumptions can be violated in practice, e.g. during a resize.

python-prompt-toolkit addresses this problem by displaying something like "window too small" whenever that's the case (and the window is big enough for that text still). I think that would be great to have here for robustness, too.

What do you think?

PS: This may or may not be related to #77.

https://user-images.githubusercontent.com/1577132/224890903-a074ab52-20f5-46df-a135-83e2e6e6183d.mp4

tenox7 commented 1 year ago

Yeah great idea thank you!

hartwork commented 11 months ago

This is still broken with latest 1.5.1. I'll adjust the title accordingly…

hartwork commented 10 months ago

It turns that /dev/random triggers multiple things — including undefined behavior — needs more investigation. For the simple part — displaying a message when then window is too small — pull request #97 is now ready for review.

hartwork commented 10 months ago

Closing as fixed by #97 in release 1.5.2; for the undefined behavior as aspect there is dedicated issue #111 by now…