mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 14:26:46 +00:00
Merge branch 'main' of github.com:tw93/Mole
This commit is contained in:
@@ -562,7 +562,7 @@ main() {
|
||||
|
||||
# Calculate name width: use actual max, but constrain by terminal width
|
||||
# Fixed elements: "99. " (4) + " " (2) + " | Last: " (11) = 17
|
||||
local term_width=$(tput cols 2>/dev/null || echo 100)
|
||||
local term_width=$(tput cols 2> /dev/null || echo 100)
|
||||
local available_for_name=$((term_width - 17 - max_size_width - max_last_width))
|
||||
|
||||
# Dynamic minimum for better spacing on wide terminals
|
||||
|
||||
@@ -561,7 +561,7 @@ main() {
|
||||
|
||||
# Calculate name width: use actual max, but constrain by terminal width
|
||||
# Fixed elements: "99. " (4) + " " (2) + " | Last: " (11) = 17
|
||||
local term_width=$(tput cols 2>/dev/null || echo 100)
|
||||
local term_width=$(tput cols 2> /dev/null || echo 100)
|
||||
local available_for_name=$((term_width - 17 - max_size_width - max_last_width))
|
||||
|
||||
# Dynamic minimum for better spacing on wide terminals
|
||||
|
||||
@@ -99,11 +99,11 @@ select_apps_for_uninstall() {
|
||||
# Dynamic minimum: wider terminals get larger minimum for better spacing
|
||||
local min_width=18
|
||||
if [[ $terminal_width -ge 120 ]]; then
|
||||
min_width=48 # Wide terminals: very generous spacing
|
||||
min_width=48 # Wide terminals: very generous spacing
|
||||
elif [[ $terminal_width -ge 100 ]]; then
|
||||
min_width=38 # Medium-wide terminals: generous spacing
|
||||
min_width=38 # Medium-wide terminals: generous spacing
|
||||
elif [[ $terminal_width -ge 80 ]]; then
|
||||
min_width=25 # Standard terminals
|
||||
min_width=25 # Standard terminals
|
||||
fi
|
||||
|
||||
[[ $max_name_width -lt $min_width ]] && max_name_width=$min_width
|
||||
|
||||
@@ -508,7 +508,7 @@ paginated_multi_select() {
|
||||
# Normal: show full controls (without O ↑/↓ to save space)
|
||||
# Dynamically reduce controls if they won't fit
|
||||
local term_width="${COLUMNS:-}"
|
||||
[[ -z "$term_width" ]] && term_width=$(tput cols 2>/dev/null || echo 80)
|
||||
[[ -z "$term_width" ]] && term_width=$(tput cols 2> /dev/null || echo 80)
|
||||
|
||||
# Helper to calculate display length without ANSI codes
|
||||
_calc_len() {
|
||||
|
||||
Reference in New Issue
Block a user