console-rs / dialoguer

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

Always display current char when terminal is buffered #232

Closed data-retriever closed 1 year ago

data-retriever commented 1 year ago

When a buffered terminal is used (like Term::buffered_stderr()), the current char won't always be printed if the user is typing a string that doesn't match anything.

This PR fixes this.

Also, moving the flush to outside the loop seems to be more efficient.