Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.unix.wizards Subject: Re: transferring processes under csh Message-ID: <1264@mcgill-vision.UUCP> Date: 26 Aug 88 09:10:39 GMT References: <1074@imagine.PAWL.RPI.EDU> Organization: McGill University, Montreal Lines: 46 In article <1074@imagine.PAWL.RPI.EDU>, hiebeler@pawl23.pawl.rpi.edu (David Hiebeler) writes: > Does anyone know of a way to transfer processes between different > incantations of csh? > [Suppose I put a job in the background on one terminal.] > Is there any way at all that I can, _from another terminal_, bring > that job into the foreground _on the new terminal_? First: as far as I know, there is no existing mechanism which would allow this. Insofar as this is possible, it's not exceptionally useful, and insofar as it's useful, it's not possible. It would be relatively easy (easy relative to the other points I'll bring up, that is) to hack some way into the kernel to transfer ownership of the job from the one shell to the other. It would even be possible to hotwire its file descriptors so that the ones that used to point to the old terminal now point to the new terminal. (Is this enough? You tell me.) But, and I suspect this is the reason this capability isn't available right now, this isn't good enough. Suppose the job is an editor - vi, say. The terminal will in general be a different type, implying that all vi's knowlege about the terminal must be reworked. Unfortunately, there's no way for vi to find out what the current terminal type is! Or rather, no practical way. It would require that the shell rewrite the environment in the vi process. And a mechanism to signal vi that it has to reread the environment. And nontrivial code in vi to handle this change. And in every other screen-oriented program. And rewriting the environment is, in general, not even possible without kernel modifications so extensive as to amount to half of a rewrite. If you're running 4.3 and you just want it to work for dumb programs, I can put it together for you within a day or two, I believe. But the last little bit, the part that would make it really useful, is well-nigh hopeless. There are also some difficult questions: what does the old parent process see? An exited child? Killed by some special signal number? Child vanishes without dying (the truth, but highly confusing to existing programs)? And presumably you'd want to take over a whole job at once.... Perhaps I'll try to implement this. One thing's for sure: it should be interesting. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu