sync detect_shell across plats