terminal window size
Ive been trying to find how to make a c program what changes he size of the terminal window. I tried with google with no results :(
i'm actually trying to make my program to be able to get this information as command line parameters.. e.g myprogram -x 10 -y 5
i'm using linux + gcc.
do you mean to change the geometry of the window? which terminal? most graphic terminal on an unix-like system have this builtin option (-g 100x100+5+5 for instance). If you want to program it, you need in particular the XMoveResizeWindow() Xlib call (plus all the init code and the window id lookup).
What is a "terminal window"?
Are you talking about re-sizing an Xterm window running under X?
i mean a terminal emulator window like putty.. i'd like to be able to resize the number of lines there are in the window directly from my program. sorry for my poor english...
Whichever terminal-type being emulated will have to support the concept of being resized - and the emulator itself would need to recognize this and resize its X window.
With all that in place, my first attempt would be to run "stty cols N rows N".
You almost certainly can not resize the Windows Console (CMD) from your Linux/Unix application. If you are forwarding X-windows applications over SSH via PuTTY, then you could resize the X term window on Windows using the method described above. But Windows itself is responsible for the Console windows, and they aren't "available" to a Linux/Unix machine in any way shape or form.
Originally Posted by eight8ball