O_o

Conceptually, you can change the size of the terminal window from within a program.

Practicably, you aren't going to do that unless you only hope to reduce the window size.

If you are running a system that isn't running under a "X Server" instance:
The size of the terminal is usually fixed by the loader. Any attempt you make to circumvent this may fail without error, fail with an error, or crash the virtual terminal instance. It depends on how virtual terminals are configured, what fonts are available, and what driver is responsible for the drawing.

If you are running a system that is running under a "X Server" instance:
You still have no guarantees. The size of a "X" terminal emulator can usually be adjusted, but different terminal emulators handle it differently. It also happens that the shell will occasionally stand in your way. It is theoretically possible to use a combination of terminal emulator specific calls with terminal interface library (You may wish to try "ncurses".) signal handlers to force a size adjustment within a program while leaving the terminal useable. This just isn't likely to work. Ever.

The `resizeterm' extension will often not work to enlarge the window for all the reasons listed above plus a few extras related to security and environment variables. It depends on the implementations, but it is usually coded in such a way that the size can never be greater than the natural size of the original terminal being emulated unless outside influence has already increased the size beyond that limit. As an added "bonus" that will prevent people from using your program more than once: the `resizeterm' extension can affect every terminal emulator instance running under the relevant user.

Here is what you can do, and it will work. Almost always.

Variation 1: (Effort: Barely Any)
Use a terminal interface library to request the current size of the window at the top of `main' and fail gracefully with an error if the size is not sufficient for your purposes with a note about what sizes are supported. Note: Don't think you can get away with calling `resize' from the `system' function; the processes forked by `system' lives in a different universe so it just will not work.

Variation 2: (Effort: Mission Impossible)
Query permissions and optionally attempt to use "Xlib" directly to do what `resizeterm' usually doesn't do by calculating everything yourself, issuing the size adjustment commands, and optionally calling the relevant terminal interface library API to refresh the current terminal information.

Soma