Save to console history if the input is not an empty string.