Closed hartwork closed 10 months ago
Yeah great idea thank you!
This is still broken with latest 1.5.1. I'll adjust the title accordingly…
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.
Closing as fixed by #97 in release 1.5.2; for the undefined behavior as aspect there is dedicated issue #111 by now…
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…
plotheight=height-4;
(width/2)-14
(width/2)-(strlen(title)/2)
…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