-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inquire forgets to add newlines in 0.7.1 #233
Comments
Hey, I haven't been able to reproduce the issue, can you give me more details? Maybe a repo that reproes the issue This may be limtied to Alacritty, but unfortunately I can't try alacritty right now as it seems the Mac installer has some issues, but my tests have been fine on both Mac and Ubuntu (via SSH) systems. |
I encountered the same problem, and below are my test codes: use inquire::Text;
fn main() {
loop {
match Text::new(">>").prompt() {
Ok(text) => println!("{}", text),
Err(e) => println!("Error: {}", e),
}
}
} I noticed that if I run the program and just press enter key about 12 times, then it will lose the newline after the echo of my input: I'm using Windows 11, and I have tried it on PowerShell and CMD, but both appear the same problem and even the CMD only need 11 enter keys. |
Thanks @Sydonian, I was able to reproduce the issue after the "press enter until it happens" advice. No idea how this even works half the time, but from my tests when it reached the "broken state" it stayed like that. Looks like the issue is because the new rendering logic ignores empty lines. Can you pleae test the fix? [dependencies]
inquire = { git = "https://github.com/mikaelmello/inquire.git", branch = "mm/fix-new-line-prompt-end" } |
I tried this on the test program and my project, both work fine, thank you! |
Can also confirm the branch works. I always accepted the default value for the first prompt, so the bug always triggered for me. |
* Fix missing newlines at end of prompts Fixes #233 * Fix changelog
Describe the bug
I just upgraded from 0.6.2 to 0.7.1. Suddenly, all prompts overwrite the previous prompt, as if there is a newline missing.
To Reproduce
Steps to reproduce the behavior:
CustomType::...::prompt()
Expected behavior
I expect a newline to be added to the previous prompt, so that the next prompt does not overwrite the previous one.
Desktop (please complete the following information):
BrowserTerminal: alacrittyThe text was updated successfully, but these errors were encountered: