Merging the savefile branch. I hope it works; I even don't remember it.
Pseudo-terminals:
http://tldp.org/HOWTO/Text-Terminal-HOWTO-7.html
Job Control and sessions:
http://www.fh-wedel.de/~di/html/glibc/libc_24.html (Job Control)
Interesting on 'setsid'.
http://www.hmug.org/man/4/termios.php (on The Controlling Terminal)