* Fix garbled display in virtual console by clearing the terminal. master
authorUrban Wallasch <urban.wallasch@freenet.de>
Sat, 4 Jul 2020 10:01:08 +0000 (12:01 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Sat, 4 Jul 2020 10:01:08 +0000 (12:01 +0200)
XbpsUI.sh

index 00575446e81f664abe913344422992d363e4dd61..058a58df5f5522840e2447f23cff43200651c6b2 100755 (executable)
--- a/XbpsUI.sh
+++ b/XbpsUI.sh
@@ -109,24 +109,28 @@ function runCmd() {
 
 # Update repository package database:
 function syncRepo() {
+    clear
     prmsg bold "Update package lists:\n"
     runCmd $SUDO xbps-install -Sv
 }
 
 # Update all installed packages to their latest version:
 function distUpgrade() {
+    clear
     prmsg bold "Upgrade installed packages:\n"
     runCmd $SUDO xbps-install -Suv
 }
 
 # Clean cache by removing obsolete binary packages:
 function cleanCache() {
+    clear
     prmsg bold "Clean package cache:\n"
     runCmd $SUDO xbps-remove -Ov
 }
 
 # Remove orphaned packages:
 function reapOrphans() {
+    clear
     prmsg bold "Remove orphans:\n"
     if [[ -n "$( xbps-query -O )" ]] ; then
         runCmd $SUDO xbps-remove -ov
@@ -167,6 +171,7 @@ function instPkg() {
                 --header="Select packages to install.$fzfHint" |
             awk '{print $2}'
         )"
+    clear
     prmsg bold "Install:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -186,6 +191,7 @@ function reinstPkg() {
                 --header="Select packages to reinstall.$fzfHint" |
             awk '{print $2}'
         )"
+    clear
     prmsg bold "Reinstall:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -205,7 +211,7 @@ function purgePkg() {
                 --header="Select packages to purge.$fzfHint" |
             awk '{print $2}'
         )"
-
+    clear
     prmsg bold "Purge:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -225,7 +231,7 @@ function reconfPkg() {
                 --header="Select packages to reconfigure.$fzfHint" |
             awk '{print $2}'
         )"
-
+    clear
     prmsg bold "Reconfigure:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -244,7 +250,7 @@ function holdPkg() {
                 --preview "$fzfPrev1" \
                 --header="Select packages to put on hold.$fzfHint"
         )"
-
+    clear
     prmsg bold "Hold packages:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -262,7 +268,7 @@ function unholdPkg() {
                 --preview "$fzfPrev1" \
                 --header="Select packages to unhold.$fzfHint"
         )"
-
+    clear
     prmsg bold "Unhold held packages:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -281,7 +287,7 @@ function markPkgManual() {
                 --preview "$fzfPrev1" \
                 --header="Select packages to mark as manual.$fzfHint"
         )"
-
+    clear
     prmsg bold "Mark as manually installed:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -299,7 +305,7 @@ function markPkgAuto() {
                 --preview "$fzfPrev1" \
                 --header="Select packages to mark as as auto.$fzfHint"
         )"
-
+    clear
     prmsg bold " Mark as automatically installed:\n"
     if [[ -n "$pkg" ]] ; then
         pkg="$( echo "$pkg" | paste -sd " " )"
@@ -311,6 +317,7 @@ function markPkgAuto() {
 
 # Main menu:
 function menu() {
+    clear
     choice="$( echo "\
 sync        Synchronize repository package database
 upgrade     Update all packages to their latest version
@@ -339,7 +346,7 @@ quit        Quit" |
     )"
     
     # Perform requested action:
-    echo
+    clear
     date
     case "$choice" in
         "sync" )       syncRepo      ;;