A patient on mechanical ventilation has a sudden decrease in SpO2 and a shift of the trachea to the unaffected side.The most likely diagnosis is: