From: Martin Pitt Date: Mon, 28 Sep 2026 09:56:42 +0000 (+0200) Subject: shellpresent: Keep tty for executed commands X-Git-Url: https://piware.de/gitweb/?a=commitdiff_plain;h=28c3819e2dde25488bf5d6d58cce507c6ee10adf;p=bin.git shellpresent: Keep tty for executed commands --- diff --git a/shellpresent b/shellpresent index b0758f7..fcf1ba0 100755 --- a/shellpresent +++ b/shellpresent @@ -39,7 +39,7 @@ fi clear echo -en "\e[${PROMPT}m\$\e[${CMD}m " -while read line; do +while IFS= read -r line <&3; do # paragraph clears screen if [ -z "$line" ]; then clear @@ -58,9 +58,9 @@ while read line; do # execute command echo -n "$line" - read < /dev/tty + read echo -ne "\e[${OUTPUT}m" - eval "$line" + eval "$line" 3<&- echo -en "\n\e[${PROMPT}m\$\e[${CMD}m " - read -s < /dev/tty -done < "$1" + read -s +done 3< "$1"