From cf09b8e5075e5413da7cfaefd566000787ba0054 Mon Sep 17 00:00:00 2001 From: lyon Date: Mon, 1 May 2023 18:40:34 +0800 Subject: [PATCH] fix KEY_UP --- src/PikaObj.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PikaObj.c b/src/PikaObj.c index b3221f37a..05f44d04a 100644 --- a/src/PikaObj.c +++ b/src/PikaObj.c @@ -1474,6 +1474,11 @@ enum shellCTRL _inner_do_obj_runChar(PikaObj* self, if (NULL == prev) { goto __exit; } + /* move to the last position */ + for (int i = 0; i < shell->line_position - shell->line_curpos; + i++) { + _putc_cmd(PIKA_KEY_RIGHT, 1); + } /* clear the current line */ for (int i = 0; i < shell->line_position; i++) { PIKA_BACKSPACE();