-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
listbox_window: integer divide by zero #1820
Comments
Obviously Elvish shouldn't panic but the question is what should it do when a user does something like "resize window to an unreasonably small size: 7x3"? Should it silently refuse to create a completion list box? Output an error saying the window is too small? Something else? |
I'd say it should just silently refuse to create one. At most add a log for debugging. On a tiling window manager it happens fairly often for a window to get squashed to a smaller than normal size for a short time. |
I agree, and presumably everyone else does as well. What is unclear is whether silently rejecting an attempt to create a list box (or other TUI element) is the best solution. Would an explicit message such as "window size is too small" written to the terminal be preferable? Even without any rate limiting? And how would writing such a message to the terminal interact with the current prompt? The devil is in the details. |
I don't think we need to think too deeply about this. |
Hmm there's something deeper here. In general |
OK, it's a simple one 🤦 Line 51 in 3889bd0
|
What happened, and what did you expect to happen?
Seems there is still a divide by zero possible:
elvish/pkg/cli/tk/listbox_window.go
Line 128 in 2e527f7
Steps to reproduce:
Output of "elvish -version"
0.21.0-dev.0.20240609160321-2e527f77fdc7
Code of Conduct
The text was updated successfully, but these errors were encountered: