Fix: Suppress /dev/tty error in safe_read

This commit is contained in:
Bishoy Ehab
2025-10-17 14:50:26 +03:00
parent 4d20de926c
commit 3bea2a314e
+1 -1
View File
@@ -111,7 +111,7 @@ safe_read() {
local input_value=""
echo -n "$prompt"
if read -r input_value </dev/tty 2>/dev/null || read -r input_value 2>/dev/null; then
if { read -r input_value </dev/tty; } 2>/dev/null || read -r input_value 2>/dev/null; then
# Use printf instead of eval for security
printf -v "$varname" '%s' "$input_value"
return 0