Go up the process hierarchy to detect the shell.