cursewords icon indicating copy to clipboard operation
cursewords copied to clipboard

When warning about the terminal window size, it should print the minimum required

Open chungy opened this issue 6 years ago • 4 comments

Currently, when it prints a message such as:

This puzzle is 21 columns wide and 21 rows tall. The terminal window must be wider and taller to properly display it.

It doesn't give an indication of just how big the window has to be, I've had to try several times before hitting a sweet spot. Since a lot of window managers and terminal emulators will display the grid size while resizing, giving a minimum required size will save a lot of time in this scenario.

chungy avatar Mar 09 '19 08:03 chungy

I'm also getting this message for some terminal sizes. If sizing larger, then I get the Unicode error in #12. I don't seem to have a sweet spot.

mnp avatar Mar 09 '19 13:03 mnp

@chungy this is a good suggestion, and it should probably be implemented along with #5. Ideally it says the axis (or axes) on which your window needs to be larger (and, like you suggest, by how much), and allows you to resize without quitting, automatically drawing the puzzle when the window gets big enough. It would be pretty trivial to do that on open, but I'd like to make the same code work for during mid-run resizes, too, which might take a little longer.

@mnp I see you've resolved #12 now but yeah... the drawing happens after the size check, so if you're getting stopped at the size check it won't run into the ASCII issues.

thisisparker avatar Mar 09 '19 20:03 thisisparker

It doesn't give an indication of just how big the window has to be,

I agree. It would be useful if the necessary_resize function also passed the number of extra rows and/or columns. As a new user it isn't obvious that, e.g. a 15x15 grid needs 43 rows.

culcube avatar Jun 16 '21 17:06 culcube

Yeah, this is a good stopgap, although I'd guess most people don't have super ready access to the number of rows or columns in their current terminal window. In the medium term the best solution is to allow resizing of the window until it fits, and in the long term I'd like to make some kind of scrolling functionality.

thisisparker avatar Jun 16 '21 18:06 thisisparker