Better prompt handling without readline