fish_key_reader: fix off-by-one crash

This commit is contained in:
Fabian Boehm 2024-02-01 21:42:55 +01:00
parent cf3d3f6497
commit d50b614250
2 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,7 @@ fn must_escape(c: char) -> bool {
}
fn ctrl_to_symbol(buf: &mut WString, c: char, bind_friendly: bool) {
let ctrl_symbolic_names: [&wstr; 28] = {
let ctrl_symbolic_names: [&wstr; 29] = {
std::array::from_fn(|i| match i {
8 => L!("\\b"),
9 => L!("\\t"),

View File

@ -49,6 +49,10 @@ expect_str("char: \\e\r\n")
expect_str("char: \\x7F")
expect_str("""(aka "del")\r\nbind \\e\\x7F 'do something'\r\n""")
send("\x1c")
expect_str(r"char: \c\ (or \x1c)")
expect_str(r"bind \x1c 'do something'")
# Does it keep running if handed control sequences in the wrong order?
send("\x03")
sleep(0.010)