News for hackers. Stuff that matters.
Re:Do You Understand Job Control in Bash? by mcantor on Thursday September 02, 2010 @11:24PM (#1658527)

    disown
 	
    disown [-ar] [-h] [jobspec ...]

    Without options, each jobspec is removed from the table of active jobs.
    If the `-h' option is given, the job is not removed from the table,
    but is marked so that SIGHUP is not sent to the job if the shell receives
    a SIGHUP. If jobspec is not present, and neither the `-a' nor `-r'
    option is supplied, the current job is used. If no jobspec is
    supplied, the `-a' option means to remove or mark all jobs; the `-r'
    option without a jobspec argument restricts operation to running jobs.
The important part:

That means...

    $ ./some_really_long_process
    (crud... I forgot to open GNU Screen first!)
    ^Z
    [1]+ Stopped
    $ bg
    [1]+ ./some_really_long_process &
    $ disown
    $ pgrep some_really_long_process
    12349
    $ logout
Now, log in again...

    $ pgrep some_really_long_process
    12349
I do not know of a way to "reclaim" a disowned process, though.
Re:Do You Understand Job Control in Bash? by nodata on Friday September 03, 2010 @04:10AM (#1658936)
> I do not know of a way to "reclaim" a disowned process, though.

http://caca.zoy.org/wiki/neercs

Maybe someone can rip out the relevant parts and create "reattach" and get it in coreutils :)

Re:Do You Understand Job Control in Bash? by imurray on Friday September 03, 2010 @04:50AM (#1658980)
I'll have to try this.

I have tried http://pasky.or.cz/~pasky/dev/retty/ before, with limited success. It would reattach a terminal running vim, but not Matlab, and was generally a bit flakey.

EDIT: I have now tried neercs. Like retty, vim can be stolen but attempting to steal zsh shell or Matlab sessions causes crashes.

I was once told VMS used to have decent native support for reattaching terminals? It's frustrating that we don't have this ability (at least not seemlessly) now.

There was a project to make screen easier to use, integrating it with gnome-terminal: http://monia.wordpress.com/2006/08/31/integrating-gnome-term... but the patches were never accepted.