console-rs / dialoguer

Rust utility library for nice command line prompts and similar things
MIT License
1.33k stars 142 forks source link

`Input` post completion text does not appear if the user uses the default #309

Open doonv opened 7 months ago

doonv commented 7 months ago

I have a Input that looks like this:

let result: String = Input::new()
        .with_prompt("My Prompt")
        .with_post_completion_text("Completed Prompt")
        .default("My Default".to_string())
        .interact_text()
        .unwrap();

If the user types in their own input, everything works as intended. However if the user just presses Enter to use the default string, then the post completion text does not appear, instead the prompt appears.