mirror of
https://github.com/tw93/Mole.git
synced 2026-03-24 12:20:06 +00:00
🐛 Fixed duplicate display issue
This commit is contained in:
@@ -24,9 +24,12 @@ mole # Interactive main menu
|
|||||||
mole clean # Deep system cleanup
|
mole clean # Deep system cleanup
|
||||||
mole clean --dry-run # Preview cleanup (no deletions)
|
mole clean --dry-run # Preview cleanup (no deletions)
|
||||||
mole uninstall # Interactive app uninstaller
|
mole uninstall # Interactive app uninstaller
|
||||||
|
mole update # Update Mole to the latest version
|
||||||
mole --help # Show help
|
mole --help # Show help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Navigation:** Use arrow keys (↑/↓), Space to select, Enter to confirm, Q to quit or Ctrl+C to force exit.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Deep System Cleanup
|
### Deep System Cleanup
|
||||||
|
|||||||
28
mole
28
mole
@@ -144,12 +144,13 @@ show_help() {
|
|||||||
printf " %s%s%s [command]\n\n" "$GREEN" "mole" "$NC"
|
printf " %s%s%s [command]\n\n" "$GREEN" "mole" "$NC"
|
||||||
|
|
||||||
printf "%s%s%s\n" "$BLUE" "COMMANDS" "$NC"
|
printf "%s%s%s\n" "$BLUE" "COMMANDS" "$NC"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole" "$NC" "Interactive main menu"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole" "$NC" "Interactive main menu"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole clean" "$NC" "Deeper system cleanup"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole clean" "$NC" "Deeper system cleanup"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole uninstall" "$NC" "Remove applications completely"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole clean --dry-run" "$NC" "Preview cleanup (no deletions)"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole update" "$NC" "Update Mole to the latest version"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole uninstall" "$NC" "Remove applications completely"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole --version" "$NC" "Show installed version"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole update" "$NC" "Update Mole to the latest version"
|
||||||
printf " %s%-16s%s %s\n" "$GREEN" "mole --help" "$NC" "Show this help message"
|
printf " %s%-20s%s %s\n" "$GREEN" "mole --version" "$NC" "Show installed version"
|
||||||
|
printf " %s%-20s%s %s\n" "$GREEN" "mole --help" "$NC" "Show this help message"
|
||||||
|
|
||||||
printf "\n%s%s%s\n" "$BLUE" "MORE" "$NC"
|
printf "\n%s%s%s\n" "$BLUE" "MORE" "$NC"
|
||||||
printf " https://github.com/tw93/mole\n\n"
|
printf " https://github.com/tw93/mole\n\n"
|
||||||
@@ -216,10 +217,13 @@ show_main_menu() {
|
|||||||
echo ""
|
echo ""
|
||||||
show_brand_banner
|
show_brand_banner
|
||||||
echo ""
|
echo ""
|
||||||
|
# Save cursor position right before menu items
|
||||||
|
printf '\033[s'
|
||||||
|
else
|
||||||
|
# Restore to saved position and clear everything from there
|
||||||
|
printf '\033[u\033[0J'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '\033[s' # Save cursor position
|
|
||||||
|
|
||||||
show_menu_option 1 "Clean System - Remove junk files and optimize" "$([[ $selected -eq 1 ]] && echo true || echo false)"
|
show_menu_option 1 "Clean System - Remove junk files and optimize" "$([[ $selected -eq 1 ]] && echo true || echo false)"
|
||||||
show_menu_option 2 "Uninstall Apps - Remove applications completely" "$([[ $selected -eq 2 ]] && echo true || echo false)"
|
show_menu_option 2 "Uninstall Apps - Remove applications completely" "$([[ $selected -eq 2 ]] && echo true || echo false)"
|
||||||
show_menu_option 3 "Help & Information - Usage guide and tips" "$([[ $selected -eq 3 ]] && echo true || echo false)"
|
show_menu_option 3 "Help & Information - Usage guide and tips" "$([[ $selected -eq 3 ]] && echo true || echo false)"
|
||||||
@@ -238,7 +242,6 @@ interactive_main_menu() {
|
|||||||
local first_draw=true
|
local first_draw=true
|
||||||
|
|
||||||
cleanup_and_exit() {
|
cleanup_and_exit() {
|
||||||
printf '\033[u\033[J' # Restore cursor and clear
|
|
||||||
show_cursor
|
show_cursor
|
||||||
echo ""
|
echo ""
|
||||||
echo "Thank you for using Mole!"
|
echo "Thank you for using Mole!"
|
||||||
@@ -249,12 +252,9 @@ interactive_main_menu() {
|
|||||||
hide_cursor
|
hide_cursor
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
show_main_menu $current_option "$first_draw"
|
||||||
if [[ "$first_draw" == "true" ]]; then
|
if [[ "$first_draw" == "true" ]]; then
|
||||||
show_main_menu $current_option true
|
|
||||||
first_draw=false
|
first_draw=false
|
||||||
else
|
|
||||||
printf '\033[u' # Restore cursor position
|
|
||||||
show_main_menu $current_option false
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local key=$(read_key)
|
local key=$(read_key)
|
||||||
@@ -264,7 +264,6 @@ interactive_main_menu() {
|
|||||||
"UP") ((current_option > 1)) && ((current_option--)) ;;
|
"UP") ((current_option > 1)) && ((current_option--)) ;;
|
||||||
"DOWN") ((current_option < 4)) && ((current_option++)) ;;
|
"DOWN") ((current_option < 4)) && ((current_option++)) ;;
|
||||||
"ENTER"|"$current_option")
|
"ENTER"|"$current_option")
|
||||||
printf '\033[u\033[J' # Clear menu
|
|
||||||
show_cursor
|
show_cursor
|
||||||
case $current_option in
|
case $current_option in
|
||||||
1)
|
1)
|
||||||
@@ -302,7 +301,6 @@ interactive_main_menu() {
|
|||||||
;;
|
;;
|
||||||
"QUIT") cleanup_and_exit ;;
|
"QUIT") cleanup_and_exit ;;
|
||||||
[1-4])
|
[1-4])
|
||||||
printf '\033[u\033[J'
|
|
||||||
show_cursor
|
show_cursor
|
||||||
case $key in
|
case $key in
|
||||||
1)
|
1)
|
||||||
|
|||||||
Reference in New Issue
Block a user