Skip to content

Commit

Permalink
Do not error on Key::Unknown in input and confirm (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed May 21, 2023
1 parent c8cdaf3 commit dcb1974
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/prompts/confirm.rs
Expand Up @@ -194,12 +194,6 @@ impl Confirm<'_> {
Key::Escape | Key::Char('q') if allow_quit => {
value = None;
}
Key::Unknown => {
return Err(io::Error::new(
io::ErrorKind::NotConnected,
"Not a terminal",
))?;
}
_ => {
continue;
}
Expand All @@ -218,12 +212,6 @@ impl Confirm<'_> {
Key::Char('n') | Key::Char('N') => Some(false),
Key::Enter if self.default.is_some() => Some(self.default.unwrap()),
Key::Escape | Key::Char('q') if allow_quit => None,
Key::Unknown => {
return Err(io::Error::new(
io::ErrorKind::NotConnected,
"Not a terminal",
))?;
}
_ => {
continue;
}
Expand Down

0 comments on commit dcb1974

Please sign in to comment.