mirror of
https://github.com/rworkman/slackpkg
synced 2025-01-30 20:35:00 +01:00
Adjust number of .new lines shown based on terminal size
Signed-off-by: Robby Workman <rworkman@slackware.com>
This commit is contained in:
parent
d93ee0f36d
commit
2cae1aa0af
1 changed files with 7 additions and 3 deletions
|
@ -145,15 +145,19 @@ looknew() {
|
||||||
echo -ne "\n\
|
echo -ne "\n\
|
||||||
Some packages had new configuration files installed ($newcount new files):\n\n"
|
Some packages had new configuration files installed ($newcount new files):\n\n"
|
||||||
|
|
||||||
if [ $newcount -le 15 ]; then
|
SIZE=$(stty size)
|
||||||
echo -e "\n$FILES\n"
|
ROWS=${SIZE% *}
|
||||||
|
LISTMAX=$((ROWS-20))
|
||||||
|
|
||||||
|
if [ $newcount -le $LISTMAX ]; then
|
||||||
|
echo -e "$FILES"
|
||||||
else
|
else
|
||||||
F=0
|
F=0
|
||||||
for FN in $FILES; do
|
for FN in $FILES; do
|
||||||
F=$((F+1))
|
F=$((F+1))
|
||||||
echo "$FN"
|
echo "$FN"
|
||||||
|
|
||||||
if [ $F -ge 14 ]; then
|
if [ $F -ge $LISTMAX ]; then
|
||||||
F=0
|
F=0
|
||||||
echo -ne "\nPress SPACE for more, ENTER to skip"
|
echo -ne "\nPress SPACE for more, ENTER to skip"
|
||||||
IFS=$'\n' read -rn 1 junk
|
IFS=$'\n' read -rn 1 junk
|
||||||
|
|
Loading…
Add table
Reference in a new issue