Prevent select-all hack from confusing readInput when there is a selection

Issue #2496