Hi Derek: Thanks for the input.
I know that stderr is duplicated, so that's not a problem. I long suspected terminal problems, but I know that openpty is setting the term correctly from when I was mucking around with whether or not I wanted the terminal running in canonical mode. I changed out the call to setsid, but that didn't change anything. I've also tried using tcsetpgrp() and calling fork() and exit() to make the shell an orphaned process -- neither of which seemed to do any good. I used to suspect that the pty wasn't set up correctly and I eventually ended up duplicating the termios structure bit by bit and setting the pty to the characteristics that a pty from ssh gets, but that didn't do the trick either. That suggests to me that the problem isn't terminal related, but rather that it's related to the setup of the child process. Maybe this is the fault of an environment variable? -Phil