console-rs / dialoguer

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

feat: support multi line input #297

Open mirsella opened 11 months ago

mirsella commented 11 months ago

Hello !

Would be very useful to have a way of writing multiple lines in an Input. For example, copying and pasting this text:

foo
bar

Would take only foo.

To know when to stop, maybe we can stop when getting an empty string back, for example with std::io::stdin().read_line(&mut buffer) will return 0 (because it didn't read anything) and not modify buffer.

Thanks !

ThatFrogDev commented 9 months ago

Yes, this would be indeed very awesome! I need that for my app too. Thanks for the request!