-# http://stackoverflow.com/questions/1780483/lines-and-columns-environmental-variables-lost-in-a-script
-if [[ -n $( type -p tput ) ]];then
- TERM_COLUMNS=$(tput cols)
- TERM_LINES=$(tput lines)
-fi
-# double check, just in case it's missing functionality or whatever
-if [[ -n ${TERM_COLUMNS##[0-9]*} ]];then
- TERM_COLUMNS=80
- TERM_LINES=100
+## sometimes will trigger an error (mageia) if not in shell
+if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
+ if [[ -n $( type -p tput ) ]];then
+ TERM_COLUMNS=$(tput cols)
+ TERM_LINES=$(tput lines)
+ fi
+ # double check, just in case it's missing functionality or whatever
+ if [[ -n ${TERM_COLUMNS##[0-9]*} ]];then
+ TERM_COLUMNS=80
+ TERM_LINES=100
+ fi