summaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2021-06-04 15:20:38 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-07 16:07:40 +0000
commite966cba34e9ead0f9c64919738992e9b7e1d1076 (patch)
tree1a93ff9dbb921f297212206deddd085a412c94d9 /common/console.c
parent475fb9657749dcb12941affcaa46c000f412878b (diff)
downloadchrome-ec-e966cba34e9ead0f9c64919738992e9b7e1d1076.tar.gz
console: add correct escape sequence for End key
Push the end key on the ec console will working correctly BRANCH=none BUG=none TEST=guybrush EC image, End key works Change-Id: I78c36caba38a1e45d85f738f6c0bd90ae9a48c4e Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2940573 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index cf25b40c30..e7adc084b3 100644
--- a/common/console.c
+++ b/common/console.c
@@ -56,6 +56,7 @@ static enum {
ESC_BRACKET, /* Got ESC [ */
ESC_BRACKET_1, /* Got ESC [ 1 */
ESC_BRACKET_3, /* Got ESC [ 3 */
+ ESC_BRACKET_4, /* Got ESC [ 4 */
ESC_O, /* Got ESC O */
} esc_state;
#endif /* !defined(CONFIG_EXPERIMENTAL_CONSOLE) */
@@ -418,6 +419,9 @@ static int handle_esc(int c)
} else if (c == '3') {
esc_state = ESC_BRACKET_3;
return -1;
+ } else if (c == '4') {
+ esc_state = ESC_BRACKET_4;
+ return -1;
}
if (c == 'A')
@@ -445,6 +449,11 @@ static int handle_esc(int c)
return KEY_DEL;
break;
+ case ESC_BRACKET_4:
+ if (c == '~')
+ return KEY_END;
+ break;
+
default:
break;
}