mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 13:26:18 +00:00
Merge branch 'main' of github.com:tw93/Mole
This commit is contained in:
@@ -98,10 +98,10 @@ perform_purge() {
|
|||||||
# Function to truncate path in the middle
|
# Function to truncate path in the middle
|
||||||
truncate_path() {
|
truncate_path() {
|
||||||
local path="$1"
|
local path="$1"
|
||||||
local term_width=$(tput cols 2>/dev/null || echo 80)
|
local term_width=$(tput cols 2> /dev/null || echo 80)
|
||||||
# Reserve space: "| Scanning " = 12 chars, spinner = 2 chars, margins = 4 chars
|
# Reserve space: "| Scanning " = 12 chars, spinner = 2 chars, margins = 4 chars
|
||||||
local max_len=$((term_width - 18))
|
local max_len=$((term_width - 18))
|
||||||
|
|
||||||
# Minimum length to avoid too short
|
# Minimum length to avoid too short
|
||||||
[[ $max_len -lt 40 ]] && max_len=40
|
[[ $max_len -lt 40 ]] && max_len=40
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user