no version change, just added wrapper around tput cols so only use it if in terminal

This commit is contained in:
inxi-svn 2014-03-15 17:56:51 +00:00
parent c8b6706bc5
commit 40053aa5b7
2 changed files with 23 additions and 9 deletions

12
inxi
View file

@ -494,15 +494,17 @@ COLS_MAX=''
TERM_COLUMNS=80 TERM_COLUMNS=80
TERM_LINES=100 TERM_LINES=100
# http://stackoverflow.com/questions/1780483/lines-and-columns-environmental-variables-lost-in-a-script ## sometimes will trigger an error (mageia) if not in shell
if [[ -n $( type -p tput ) ]];then if [[ $B_RUNNING_IN_SHELL == 'true' ]];then
if [[ -n $( type -p tput ) ]];then
TERM_COLUMNS=$(tput cols) TERM_COLUMNS=$(tput cols)
TERM_LINES=$(tput lines) TERM_LINES=$(tput lines)
fi fi
# double check, just in case it's missing functionality or whatever # double check, just in case it's missing functionality or whatever
if [[ -n ${TERM_COLUMNS##[0-9]*} ]];then if [[ -n ${TERM_COLUMNS##[0-9]*} ]];then
TERM_COLUMNS=80 TERM_COLUMNS=80
TERM_LINES=100 TERM_LINES=100
fi
fi fi
# Only for legacy user config files se we can test and convert the var name # Only for legacy user config files se we can test and convert the var name

View file

@ -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 Version: 2.1.2
Patch Version: 00 Patch Version: 00