From 0567bdcb6a523466586dc9ff0692c2e776f20a5f Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 30 Aug 2023 22:03:32 +0400 Subject: [PATCH] Return `Key::Tab` instead of `\t` on windows (#182) --- src/windows_term/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/windows_term/mod.rs b/src/windows_term/mod.rs index bad5f08d..2fd625b2 100644 --- a/src/windows_term/mod.rs +++ b/src/windows_term/mod.rs @@ -390,6 +390,8 @@ pub fn read_single_key() -> io::Result { // a special keycode for `Enter`, while ReadConsoleInputW() prefers to use '\r'. if c == '\r' { Ok(Key::Enter) + } else if c == '\t' { + Ok(Key::Tab) } else if c == '\x08' { Ok(Key::Backspace) } else if c == '\x1B' {