Improve pseudo-interactive prompts using the early bash

By wrapping $(cat) in an eval, redirections and other advanced
syntax can now work in the early prompts.
Also, since "set -E" is broken is the early bash, fall back to
using "set -e" and an EXIT trap, until we can upgrade to a bash
version that already has working "set -E", or perhaps backport
it to 2.05b.
This commit is contained in:
Gábor Stefanik 2024-02-05 10:02:34 +01:00
parent 10d2a72d16
commit d50ecd58e8
2 changed files with 4 additions and 3 deletions

View file

@ -7,5 +7,5 @@
if bash --version | grep -q 'GPLv3'; then
env - PATH=${PREFIX}/bin PS1="\w # " openvt -- bash -i
else
bash -c 'while true; do printf "[early Bash - use Ctrl+D] $(pwd) # "; $(cat /dev/tty2); done' &> /dev/tty2 &
bash -c 'while true; do printf "[early Bash - use Ctrl+D] $(pwd) # "; eval "$(cat /dev/tty2)"; done' &> /dev/tty2 &
fi