From 28607cb007b0a35321746425d54e8b9ef9a0f227 Mon Sep 17 00:00:00 2001 From: andersen Date: Sat, 13 Apr 2002 13:26:49 +0000 Subject: Patch from Jim Treadway and Vladimir Oleynik to Add CTRL-K and fix CTRL-L support for cmdedit.c git-svn-id: svn://busybox.net/trunk/busybox@4610 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- shell/cmdedit.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/cmdedit.c b/shell/cmdedit.c index 3810c230a..b0309fef1 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -1263,14 +1263,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; + redraw(cmdedit_y, 0); + break; + case 12: + { + /* Control-l -- clear screen */ + int old_cursor = cursor; + printf("\033[H"); + redraw(0, len-old_cursor); } break; case 14: -- cgit v1.2.3-55-g6feb