aboutsummaryrefslogtreecommitdiff
path: root/src/raw_input.rs
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-09-13 22:14:24 +0400
committerGitHub <noreply@github.com>2026-09-13 20:14:24 +0200
commita7a1410abb76d8f926ccdf0b36c42e8ce057c555 (patch)
tree694903d966aac8cf1420c96b2f1daf9fd02e155d /src/raw_input.rs
parent0305fdb6f71a660cb5632d6fef56d8a9655fb1e1 (diff)
fix(input): accept parameterized CSI-tilde F1-F4 keys (#4067)
Terminals such as foot send F1-F4 as parameterized CSI-tilde sequences (for example F3 as `\x1b[13;1:1~`). `parse_xterm_modified_special_sequence` mapped codes 15-24 but not 11-14, so these presses were dropped before keybindings saw them. Map 11-14 to F1-F4, matching the unmodified `\x1b[11~`..`\x1b[14~` aliases already accepted. refs #1809
Diffstat (limited to 'src/raw_input.rs')
-rw-r--r--src/raw_input.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/raw_input.rs b/src/raw_input.rs
index 8d0e3a8e..fc6ff52e 100644
--- a/src/raw_input.rs
+++ b/src/raw_input.rs
@@ -1535,6 +1535,9 @@ mod tests {
(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[11;2~", KeyCode::F(1), KeyModifiers::SHIFT),
+ (b"\x1b[13;1:1~", KeyCode::F(3), KeyModifiers::empty()),
+ (b"\x1b[14;3~", KeyCode::F(4), KeyModifiers::ALT),
(b"\x1b[57364;1u", KeyCode::F(1), KeyModifiers::empty()),
(b"\x1b[57366;1u", KeyCode::F(3), KeyModifiers::empty()),
(b"\x1b[57366;2u", KeyCode::F(3), KeyModifiers::SHIFT),
@@ -1574,11 +1577,11 @@ mod tests {
}
#[test]
- fn modified_rxvt_f_key_alias_stays_unsupported() {
+ fn parses_modified_rxvt_f_key_alias() {
let (event, consumed) = extract_one_event(b"\x1b[14;3~").unwrap();
assert_eq!(consumed, 7);
- assert!(matches!(event, RawInputEvent::Unsupported));
+ assert_raw_key(event, KeyCode::F(4), KeyModifiers::ALT);
}
#[test]