ctrl-d should only exit if the buffer is empty