Start a program in a pseudo terminal, and redirect its input from stdin, and output to stdout. Originally by Rachid Koucha: http://rkoucha.fr/tech_corner/pty_pdip.html