Suppose I run a command like this in the terminal:
~$ echo 'sleep 2; echo "hello!"' | sh
then start typing the next line. After two seconds the words "hello!\n" will be inserted into whatever I'm writing. I know there is a workaround to this (pressing up then down which refreshes the prompt), however on other systems that don't have history---eg, using a MUD through telnet---this is not possible.
Does anybody know of an ncurses app or terminal emulator that separates stdin from stdout? This seems pretty easy to make in ncurses, you just have to use some clever dup2s, but before I make it I want to know if someone has done it before.
Any other solutions to the main problem are welcome, as well.