mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 12:41:08 +08:00
fish_key_reader: fix off-by-one crash
This commit is contained in:
parent
cf3d3f6497
commit
d50b614250
|
@ -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"),
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user