Skip to content

Commit dcb1974

Browse files
authored
Do not error on Key::Unknown in input and confirm (#260)
1 parent c8cdaf3 commit dcb1974

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/prompts/confirm.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,6 @@ impl Confirm<'_> {
194194
Key::Escape | Key::Char('q') if allow_quit => {
195195
value = None;
196196
}
197-
Key::Unknown => {
198-
return Err(io::Error::new(
199-
io::ErrorKind::NotConnected,
200-
"Not a terminal",
201-
))?;
202-
}
203197
_ => {
204198
continue;
205199
}
@@ -218,12 +212,6 @@ impl Confirm<'_> {
218212
Key::Char('n') | Key::Char('N') => Some(false),
219213
Key::Enter if self.default.is_some() => Some(self.default.unwrap()),
220214
Key::Escape | Key::Char('q') if allow_quit => None,
221-
Key::Unknown => {
222-
return Err(io::Error::new(
223-
io::ErrorKind::NotConnected,
224-
"Not a terminal",
225-
))?;
226-
}
227215
_ => {
228216
continue;
229217
}

0 commit comments

Comments
 (0)