Handle exec() call with options (env, pty = true, etc).