transferring processes under csh

der Mouse mouse at mcgill-vision.UUCP
Fri Aug 26 19:10:39 AEST 1988


In article <1074 at imagine.PAWL.RPI.EDU>, hiebeler at 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 at larry.mcrcim.mcgill.edu



More information about the Comp.unix.wizards mailing list