From 7f2cb474373bcedfc6f56836ef7bcb492737ecdf Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 27 Jan 2023 17:02:02 +0100 Subject: [PATCH] fish_key_reader: Don't translate things to "\v" and friends This translated ctrl-k to "\v", which is a "vertical tab", and ctrl-l to "\f" and ctrl-g to "\a". There is no "vertical tab" or "alarm" or "\f" *key*, so these shouldn't be translated. Just drop these and call them `\ck` and such. (vertical tab specifically is utterly useless and I would be okay with dropping it entirely, I have never seen it used anywhere) --- src/fish_key_reader.cpp | 4 ++-- tests/pexpects/fkr.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index b63664f76..db3c1ac93 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -36,8 +36,8 @@ struct config_paths_t determine_config_directory_paths(const char *argv0); static const wchar_t *ctrl_symbolic_names[] = { - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, L"\\a", - L"\\b", L"\\t", L"\\n", L"\\v", L"\\f", L"\\r", nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + L"\\b", L"\\t", L"\\n", nullptr, nullptr, L"\\r", nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, L"\\e", L"\\x1c", nullptr, nullptr, nullptr}; diff --git a/tests/pexpects/fkr.py b/tests/pexpects/fkr.py index 9db0f1777..e1bd0b623 100644 --- a/tests/pexpects/fkr.py +++ b/tests/pexpects/fkr.py @@ -25,7 +25,7 @@ expect_str("Press a key:") # Is a single control char echoed correctly? send("\x07") -expect_str("char: \\cG (or \\a)\r\nbind \\a 'do something'\r\n") +expect_str("char: \\cG\r\nbind \\cG 'do something'\r\n") # Is a non-ASCII UTF-8 sequence prefaced by an escape char handled correctly? sleep(0.020)