As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window.
=
#!/usr/bin/env php
In bash, the $LINES and $COLUMNS environmental variables should be able to do the trick. The will be set automatically upon any change in the terminal size. (i.e. the SIGWINCH signal)
$LINES
$COLUMNS