X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=shell%2Fcmdedit.c;h=c5f2e9da2e7e66d322cfad57169807eccd0c8db0;hb=887ca79f04cdf45874ed783c1fb9b950bf25a246;hp=3810c230a5bcf555b8cae2845f696fa9486d0ecd;hpb=889a301a0c992cef843322ba7d2af62fcf44ab2a;p=oweals%2Fbusybox.git diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 3810c230a..c5f2e9da2 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -82,7 +82,7 @@ #ifdef CONFIG_FEATURE_GETUSERNAME_AND_HOMEDIR # ifndef TEST -# include "pwd.h" +# include "pwd_.h" # else # include # endif /* TEST */ @@ -207,7 +207,8 @@ static void cmdedit_reset_term(void) handlers_sets &= ~SET_WCHG_HANDLERS; } fflush(stdout); -#ifdef CONFIG_FEATURE_CLEAN_UP +#if 0 +//#ifdef CONFIG_FEATURE_CLEAN_UP if (his_front) { struct history *n; @@ -1263,14 +1264,18 @@ prepare_to_die: input_tab(&lastWasTab); #endif break; - case 12: - /* Control-l -- clear screen - * if the len=0 and no chars in edit line */ - if (len == 0) { - printf("\033[H\033[J"); - put_prompt(); - } else { - beep(); + case 11: + /* Control-k -- clear to end of line */ + *(command + cursor) = 0; + len = cursor; + printf("\033[J"); + break; + case 12: + { + /* Control-l -- clear screen */ + int old_cursor = cursor; + printf("\033[H"); + redraw(0, len-old_cursor); } break; case 14: