Stdio detection and handling.