davidrg / ckwin

Kermit 95 (C-Kermit for Windows) - scriptable internet and serial communications with terminal emulation
Other
60 stars 15 forks source link

Support changing terminal max width/height at runtime #259

Open davidrg opened 1 month ago

davidrg commented 1 month ago

Currently the maximum terminal height is hard-coded to 128 rows, and the max width is hard-coded to either 256 or 512 columns depending on build.

Having to pick a single value is not ideal - 512 columns is only enough to fill a 4K display at a 10pt font - larger displays or smaller fonts will give a terminal window smaller than the display. Increasing this value further is problematic though as it increases memory use whether the extra columns are ever used or not - the bump from 256 to 512 increased memory use by around 1MB.

Ideally this value could be set by command, or set automatically when the window is resized to something greater than the current limits. This would require being able to allocate at runtime (and perhaps reallocate while preserving contents) all of the various arrays dimensioned by MAXSCRNCOL, MAXNUMCOL, MAXTERMCOL, MAXSCRNROW, MAXNUMROW, and MAXTERMROW.

This change would only affect Windows (OS/2 has hard limits on maximum console dimensions), and possibly only K95G depending on what, if any, limits the various windows versions place on their console environments.