From efe7c557690157a4e133cd60dd7e2ec1bf6124f7 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 15 Jun 2026 04:53:46 +0300 Subject: fix: accept alternate f1-f4 key sequences refs #574 --- src/raw_input.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/raw_input.rs') diff --git a/src/raw_input.rs b/src/raw_input.rs index 8925e4a4..fddcb3fd 100644 --- a/src/raw_input.rs +++ b/src/raw_input.rs @@ -954,6 +954,7 @@ mod tests { (b"\x1b[57420;1u", KeyCode::Down, KeyModifiers::empty()), (b"\x1b[57423;1u", KeyCode::Home, KeyModifiers::empty()), (b"\x1bOq", KeyCode::Char('1'), KeyModifiers::empty()), + (b"\x1b[14~", KeyCode::F(4), KeyModifiers::empty()), (b"\x1b[49:33;2:1u", KeyCode::Char('1'), KeyModifiers::SHIFT), ]; @@ -987,6 +988,14 @@ mod tests { assert!(matches!(event, RawInputEvent::Unsupported)); } + #[test] + fn modified_rxvt_f_key_alias_stays_unsupported() { + let (event, consumed) = extract_one_event(b"\x1b[14;3~").unwrap(); + + assert_eq!(consumed, 7); + assert!(matches!(event, RawInputEvent::Unsupported)); + } + #[test] fn flushes_lone_escape_after_timeout() { let (tx, mut rx) = mpsc::channel(4); -- cgit v1.2.3