@@ -116,6 +116,8 @@ pub(crate) mod keys {
116116 pub(crate) const ESC: &str = "esc";
117117 pub(crate) const SPACE: &str = "space";
118118 pub(crate) const MINUS: &str = "minus";
119+ pub(crate) const LESS_THAN: &str = "lt";
120+ pub(crate) const GREATER_THAN: &str = "gt";
119121}
120122
121123impl fmt::Display for KeyEvent {
@@ -156,6 +158,8 @@ impl fmt::Display for KeyEvent {
156158 KeyCode::Esc => f.write_str(keys::ESC)?,
157159 KeyCode::Char(' ') => f.write_str(keys::SPACE)?,
158160 KeyCode::Char('-') => f.write_str(keys::MINUS)?,
161+ KeyCode::Char('<') => f.write_str(keys::LESS_THAN)?,
162+ KeyCode::Char('>') => f.write_str(keys::GREATER_THAN)?,
159163 KeyCode::F(i) => f.write_fmt(format_args!("F{}", i))?,
160164 KeyCode::Char(c) => f.write_fmt(format_args!("{}", c))?,
161165 };
@@ -228,6 +232,8 @@ impl std::str::FromStr for KeyEvent {
228232 keys::ESC => KeyCode::Esc,
229233 keys::SPACE => KeyCode::Char(' '),
230234 keys::MINUS => KeyCode::Char('-'),
235+ keys::LESS_THAN => KeyCode::Char('<'),
236+ keys::GREATER_THAN => KeyCode::Char('>'),
231237 single if single.chars().count() == 1 => KeyCode::Char(single.chars().next().unwrap()),
232238 function if function.len() > 1 && function.starts_with('F') => {
233239 let function: String = function.chars().skip(1).collect();
@@ -548,8 +554,6 @@ mod test {
548554
549555 #[test]
550556 fn parsing_unsupported_named_keys() {
551− assert!(str::parse::<KeyEvent>("lt").is_err());
552− assert!(str::parse::<KeyEvent>("gt").is_err());
553557 assert!(str::parse::<KeyEvent>("plus").is_err());
554558 assert!(str::parse::<KeyEvent>("percent").is_err());
555559 assert!(str::parse::<KeyEvent>("semicolon").is_err());