mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
no version change, just added wrapper around tput cols so only use it if in terminal
This commit is contained in:
parent
c8b6706bc5
commit
40053aa5b7
12
inxi
12
inxi
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue