From dcb1974e6a89e7fe48e8d36e30be851d36617b41 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 21 May 2023 22:39:58 +0200 Subject: [PATCH] Do not error on Key::Unknown in input and confirm (#260) --- src/prompts/confirm.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/prompts/confirm.rs b/src/prompts/confirm.rs index f43f6af0..386105eb 100644 --- a/src/prompts/confirm.rs +++ b/src/prompts/confirm.rs @@ -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; } @@ -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; }