You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works well when the user enters bytes directly. However, when inputting bytes via redirect or pipe (e.g. echo "foo" | cmd or cmd < infile), this returns Bad file descriptor when entering the password.
called `Result::unwrap()` on an `Err` value: IO(Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" })
The text was updated successfully, but these errors were encountered:
sorairolake
changed the title
Password: Returns Err when used in conjunction with input via redirect or pipePassword: Returns Err when used in conjunction with input via redirect or pipe
Dec 1, 2023
Not sure if it's related, but I have a similar problem with FuzzySelect.
Example:
use dialoguer::FuzzySelect;fnmain(){let options = ["abc","def","ghi"];let index = FuzzySelect::new().with_prompt("Select").items(&options).interact().unwrap();println!("selected: {}", options[index]);}
This works fine when stdin is empty, but when piping anything into the command it will crash:
thread 'main' panicked at src\main.rs:8:21:
called `Result::unwrap()` on an `Err` value: IO(Os { code: 1, kind: Uncategorized, message: "Incorrect function." })
The following code reads bytes from stdin and then enters the password:
This works well when the user enters bytes directly. However, when inputting bytes via redirect or pipe (e.g.
echo "foo" | cmd
orcmd < infile
), this returnsBad file descriptor
when entering the password.The text was updated successfully, but these errors were encountered: