thisisparker / cursewords

:pencil: Terminal-based crossword puzzle solving interface
GNU Affero General Public License v3.0
248 stars 28 forks source link

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

Open chungy opened 5 years ago

chungy commented 5 years ago

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.

mnp commented 5 years ago

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.

thisisparker commented 5 years ago

@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.

culcube commented 3 years ago

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.

thisisparker commented 3 years ago

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.