popen mode detection in new style