I want to print stuff to the screen separated by key presses (any key). A reduced version of what I'm trying to do is:
$ echo banana && read -rsn1 && echo orange && read -rsn1 && echo apple
That works fine in bash, as expected.
However, I would like to do that inside vim (i.e., open vim, print banana, wait for key press, print orange, wait for key press, print apple), so I thought I could use process substitution for that:
$ vim <(echo banana && read -rsn1 && echo orange && read -rsn1 && echo apple)
Unfortunately, this doesn't work: only banana is printed. It looks like it can't capture key presses and blocks there. Why not? What is going on? How can I work around this?