aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorserhat dolmaci <srhtsrht17@gmail.com>2026-08-01 19:34:29 +0300
committerGitHub <noreply@github.com>2026-08-01 19:34:29 +0300
commitd950fdfe7d3f178aec9543d3b6b2e69be998becf (patch)
treed43db293d4914ca775c3e9a744381aa92ea53e86
parent679584fdd49f9dee5ad95755af65eedc7d0f455c (diff)
fix(input): decode 0x1f as Ctrl+_ not Ctrl+- per ASCII standard (#2165)
* fix(input): decode 0x1f as Ctrl+_ not Ctrl+- per ASCII standard refs #2164 * fix(input): update control-byte matrix test for 0x1f -> Ctrl+_
-rw-r--r--src/input/parse.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input/parse.rs b/src/input/parse.rs
index b0420816..861280dd 100644
--- a/src/input/parse.rs
+++ b/src/input/parse.rs
@@ -119,7 +119,7 @@ fn parse_legacy_ctrl_char(ch: char) -> Option<TerminalKey> {
28 => Some(TerminalKey::new(KeyCode::Char('\\'), KeyModifiers::CONTROL)),
29 => Some(TerminalKey::new(KeyCode::Char(']'), KeyModifiers::CONTROL)),
30 => Some(TerminalKey::new(KeyCode::Char('^'), KeyModifiers::CONTROL)),
- 31 => Some(TerminalKey::new(KeyCode::Char('-'), KeyModifiers::CONTROL)),
+ 31 => Some(TerminalKey::new(KeyCode::Char('_'), KeyModifiers::CONTROL)),
_ => None,
}
}
@@ -792,7 +792,7 @@ mod tests {
(b'\x1c', '\\'),
(b'\x1d', ']'),
(b'\x1e', '^'),
- (b'\x1f', '-'),
+ (b'\x1f', '_'),
] {
let key = parse_terminal_key_sequence(std::str::from_utf8(&[byte]).unwrap()).unwrap();
assert_terminal_key_eq(