Only allow >>> prompt without space afterwards if line is blank

Closes issue #6025.