Switched to a simpler approache for appending to the prompt
in try_read_prompt thanks to a suggestion from takluyver