I'd like to know my current xterms' window sizes. I'm using Cygwin. Is there a command to just print that to the prompt?
If it's an actual xterm, the following should work (tested on a PuTTY session, since I don't have Cygwin installed at the moment):
In my case, that returned
All the commands involved should be standard in Cygwin or any UNIX-like system. I'd be very surprised if they didn't work equally well in a Cygwin console prompt.
Gives you the size in characters:
Whether it works in cygwin? You tell us!
If you want to avoid using a search and replace regular expression and the sed command...
Note: Run stty -a by itself to determine the position of the rows value.
In my case (an xterm in Open Solaris running Gnome), this returned 24.
If you want to avoid using a search and replace regular expression, sed, and awk ...
If you want to avoid using a search and replace regular expression, sed, grep, and awk ...
You can find the width of your terminal simply by altering one of these commands to point towards the columns value of stty -a.
If you do not like using stty -a ...