JDM@XX.LCS.MIT.EDU (Joshua D. Marantz) (06/17/87)
I have a VMS problem that I think might be best solved with pseudo-terminals. I would like to run interactive programs in a subprocess and redirect their SYS$INPUT and SYS$OUTPUT to be handled with my own routines. Currently I am using SYS$CREPRC with mailboxes specified for sys$input and sys$output. Unfortunately, the prompts do not get synchronized properly under certain circumstances, depending on how the program in the subprocess was written. Programs written in C that are intended for use on a terminal often don't pass their prompts through the mailbox until the next newline is processed. I have tried using unbuffered i/o by doing a "setbuf (stdout, NULL);" call. This solves one problem but creates another. It essentially acts as if there were a newline at the end of each printf. When there really is supposed to be a newline, that information is lost. When I try to invoke LOGINOUT as my subprogram, the behaviour is even worse. The prompts never get through. Several times I have seen reference to "pseudo-terminals" or PTYs. Does anyone know if this is a DEC supported product? I've definitely seen them referenced in VMS GNU Emacs, but I've never seen them work. I suspect that PTYs are what I want but I don't know how to get my hands on them. Does anybody know where I can find out about PTYs? Thanks, -Joshua Marantz -------