$TERM_PROGRAM is unset when running this from a java ide. This change tests $TERM_PROGRAM before further evaluation.
Merge pull request #1 from mattbishop/support-ide-exec

Support running this script from a non-terminal environment