I am writing a script that will display a stock chart as an ASCII art in a terminal emulator window. I usually use OSX / Terminal.app, but a Linux based solution would be an acceptable alternative.
My script has command line arguments for the width and height of the screen (again, as measured in CHARACTERS, not pixels), with the default values being determined by the environment variables of my own invention. I would like these scripts to determine the current window size (IN CHARACTERS) and use THAT as the default value. The typical large window size on my 17-inch Macbook Pro can be 200 x 68.
This is a perl script, but if you know the solution in some other language, tell me!
TIA.
Ken
source
share