I had similar problems and ended up writing a program to query the terminal for its size. Sources are at https://github.com/madisongh/termutils, if you'd like to use it. Since I use bash, I also needed to make sure that the 'checkwinsize' setting was turned on in my shell, to coax it into honoring the size recorded in the terminal driver. So here's a snippet from the shell profile I use:
if [ -n "$BASH_VERSION" ]; then
shopt -s checkwinsize
fi
if [ -n "$PS1" -a -x "/usr/bin/tsize" ]; then
/usr/bin/tsize
fi
That works well enough for me, as I don't dynamically resize my terminal window - I just need it set up once.