slitaz-base-files rev 135
libtaz.sh: use default device to get columns
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon Apr 16 22:45:47 2012 +0200 (2012-04-16) |
parents | 97b7836eb260 |
children | a9f3ad0aff28 |
files | rootfs/lib/libtaz.sh |
line diff
1.1 --- a/rootfs/lib/libtaz.sh Sat Apr 14 22:33:17 2012 +0200 1.2 +++ b/rootfs/lib/libtaz.sh Mon Apr 16 22:45:47 2012 +0200 1.3 @@ -68,7 +68,7 @@ 1.4 done=" <span class='done'>$okmsg</span>" 1.5 error=" <span class='error'>$ermsg</span>" ;; 1.6 *) 1.7 - local cols=$(stty -a | head -n 1 | cut -d ";" -f 3 | awk '{print $2}') 1.8 + local cols=$(stty -a -F /dev/pts/1 | head -n 1 | cut -d ";" -f 3 | awk '{print $2}') 1.9 local scol=$(($cols - 10)) 1.10 done="\\033[${scol}G[ \\033[1;${okcolor}m${okmsg}\\033[0;39m ]" 1.11 error="\\033[${scol}G[ \\033[1;${ercolor}m${ermsg}\\033[0;39m ]" ;; 1.12 @@ -87,7 +87,7 @@ 1.13 case $output in 1.14 raw|gtk) local sepchar="-" && local cols="8" ;; 1.15 html) local sepchar="<hr />" ;; 1.16 - *) local cols=$(stty -a | head -n 1 | cut -d ";" -f 3 | awk '{print $2}') ;; 1.17 + *) local cols=$(eval stty -a -F /dev/pts/1 | head -n 1 | cut -d ";" -f 3 | awk '{print $2}') ;; 1.18 esac 1.19 for c in $(seq 1 $cols); do 1.20 echo -n "$sepchar"