diff --git a/inxi b/inxi index 8bf5e5f..0c55bb8 100755 --- a/inxi +++ b/inxi @@ -494,15 +494,17 @@ COLS_MAX='' TERM_COLUMNS=80 TERM_LINES=100 -# 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 fi # Only for legacy user config files se we can test and convert the var name diff --git a/inxi.changelog b/inxi.changelog index ceba726..5843773 100755 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,15 @@ +===================================================================================== +Version: 2.1.2 +Patch Version: 00 +Script Date: 2014-03-14 +----------------------------------- +Changes: +----------------------------------- +no version change, just added wrapper around tput cols so only use it if in terminal + +----------------------------------- +-- Harald Hope - Sat, 15 Mar 2014 10:53:17 -0700 + ===================================================================================== Version: 2.1.2 Patch Version: 00