migrate detect_shell