diff --git a/cmd/status/metrics.go b/cmd/status/metrics.go index 2c65e4a..bb5df62 100644 --- a/cmd/status/metrics.go +++ b/cmd/status/metrics.go @@ -84,8 +84,8 @@ type MemoryStatus struct { UsedPercent float64 SwapUsed uint64 SwapTotal uint64 - Cached uint64 // File cache that can be freed if needed - Pressure string // macOS memory pressure: normal/warn/critical + Cached uint64 // File cache that can be freed if needed + Pressure string // macOS memory pressure: normal/warn/critical } type DiskStatus struct { diff --git a/lib/ui/menu_paginated.sh b/lib/ui/menu_paginated.sh index 1238b1d..4a2f62d 100755 --- a/lib/ui/menu_paginated.sh +++ b/lib/ui/menu_paginated.sh @@ -89,8 +89,8 @@ paginated_multi_select() { local top_index=0 local filter_query="" local filter_mode="false" # filter mode toggle - local sort_mode="${MOLE_MENU_SORT_DEFAULT:-date}" # date|name|size - local sort_reverse="false" + local sort_mode="${MOLE_MENU_SORT_MODE:-${MOLE_MENU_SORT_DEFAULT:-date}}" # date|name|size + local sort_reverse="${MOLE_MENU_SORT_REVERSE:-false}" # Live query vs applied query local applied_query="" local searching="false" @@ -198,6 +198,8 @@ paginated_multi_select() { # Cleanup function cleanup() { trap - EXIT INT TERM + export MOLE_MENU_SORT_MODE="$sort_mode" + export MOLE_MENU_SORT_REVERSE="$sort_reverse" restore_terminal unset MOLE_READ_KEY_FORCE_CHAR } @@ -895,6 +897,8 @@ paginated_multi_select() { trap - EXIT INT TERM MOLE_SELECTION_RESULT="$final_result" + export MOLE_MENU_SORT_MODE="$sort_mode" + export MOLE_MENU_SORT_REVERSE="$sort_reverse" restore_terminal return 0 ;;