david@uunet.uu.net (David Hull) (02/10/89)
A while ago there was some discussion about how to start a process in a ttysw after the ttysw has already been created. I stumbled across this while looking through the SunOS 3.4 source code. As far as I know it is completely undocumented and may not work in later releases, though it appears that is does still exist under SunOS 4.0. The call you want to use is: Tty tty; char *argv[] = { "vi", 0 }; int pid; ... pid = ttysw_fork_it(tty, argv); where ttysw is the Tty that was returned by window_create(), argv is the null-terminated list of arguments, and pid is the process id of the process that is forked off. I called ttysw_fork_it() in the frame's wait3 handler (set with notify_set_wait3_func()), to restart the editor if the user quit by mistake. As far as I know, there isn't any way to create a ttysw without a program running in it. I hope this is of help. -David