readreads the standard default input, which is redirected to a file, so it gets the line from the file. You can redirect back to the terminal:
read -p "Press Enter to continue" </dev/tty
Another option is to use another FD to redirect files
while read -u 3
do
...
done 3< test.txt
source
share