In the process of capture STDIN, STDOUT, and STDERR from the unix
shell, I have written a C program that creates 3 pseudo terminals.
Each of these pseudo terminals is connected to STDIN, STDERR, STDOUT
of the child process that runs
the unix shell program. So far every thing work just fine in the
shell, including telnet, ftp, passwd commands.
However when I start running vi editor, it seems that all key
binding in vi stops working, e.g. when I press arrow key, only garbage
shows up. I can't scroll up and down the editor. Also even if I ...