Added a flush for prompting in line-buffered environment.