mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-18 16:32:17 +00:00
fix(msg_menu): redirect menu display to /dev/tty to prevent capture in command substitution
This commit is contained in:
@@ -3351,19 +3351,21 @@ msg_menu() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display menu
|
# Display menu to /dev/tty so it doesn't get captured by command substitution
|
||||||
echo ""
|
{
|
||||||
msg_custom "📋" "${BL}" "${title}"
|
echo ""
|
||||||
echo ""
|
msg_custom "📋" "${BL}" "${title}"
|
||||||
for i in "${!tags[@]}"; do
|
echo ""
|
||||||
local marker=" "
|
for i in "${!tags[@]}"; do
|
||||||
[[ $i -eq 0 ]] && marker="* "
|
local marker=" "
|
||||||
printf "${TAB3}${marker}%s) %s\n" "${tags[$i]}" "${descs[$i]}"
|
[[ $i -eq 0 ]] && marker="* "
|
||||||
done
|
printf "${TAB3}${marker}%s) %s\n" "${tags[$i]}" "${descs[$i]}"
|
||||||
echo ""
|
done
|
||||||
|
echo ""
|
||||||
|
} >/dev/tty
|
||||||
|
|
||||||
local selection=""
|
local selection=""
|
||||||
read -r -t 10 -p "${TAB3}Select [default=${default_tag}, timeout 10s]: " selection || true
|
read -r -t 10 -p "${TAB3}Select [default=${default_tag}, timeout 10s]: " selection </dev/tty >/dev/tty || true
|
||||||
|
|
||||||
# Validate selection
|
# Validate selection
|
||||||
if [[ -n "$selection" ]]; then
|
if [[ -n "$selection" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user