Skip to content
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

fix: handle EOF in user input prompts #1293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

romanstingler
Copy link

  • Add proper EOF detection in ask() function
  • Print " -> EOF" message when EOF is received
  • Treat EOF as negative response
  • Handle input read errors explicitly

closes #1190

image
image

src/util.rs Outdated
false
match stdin.read_line(&mut input) {
Ok(0) => {
println!(" -> EOF");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pacman doesn't print anything for this. In fact it doesn't even print a new line.

Paru tries to match pacman when possible so negative on EOF is good but I don't think we should print anything but a new line. Otherwise it kind of messes up the input. I'll see about changing pacman to be like that too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this should be handled in Pacman.
Thanks for your time reviewing my stuff and giving feedback.
I will try to get all PRs fixed as soon as possible.

    Add proper EOF detection in ask() function
    Print a new line message when EOF is received
    Treat EOF as negative response
    Handle input read errors explicitly

closes Morganamilo#1190
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exit on Receving EOF
2 participants