fix: ask_confirmation tty redirection (#330)

This commit is contained in:
2025-11-02 17:10:27 +02:00
committed by GitHub
parent 82edd1dc12
commit fd49ff6968

View File

@@ -153,7 +153,7 @@ prompt_confirmation() {
# Use timeout command to limit read duration
# shellcheck disable=SC2016
if response=$(timeout "$timeout_seconds" sh -c 'read -r r && echo "$r"' 2>/dev/null); then
if response=$(timeout "$timeout_seconds" sh -c 'read -r r </dev/tty && echo "$r"' 2>/dev/null); then
: # read succeeded within timeout
else
printf '\n'