summaryrefslogtreecommitdiff
path: root/shell/cmdedit.c
diff options
context:
space:
mode:
authorEric Andersen2002-04-13 13:26:49 +0000
committerEric Andersen2002-04-13 13:26:49 +0000
commit65a0730c9fffa67249c248a83f1f2188cb84f9ea (patch)
treed5f4729393ab6f394234b99762aed7527b97dffe /shell/cmdedit.c
parent3e6908b5865d8e3ab3a986cd5a5ad86c4cea7ff5 (diff)
downloadbusybox-65a0730c9fffa67249c248a83f1f2188cb84f9ea.zip
busybox-65a0730c9fffa67249c248a83f1f2188cb84f9ea.tar.gz
Patch from Jim Treadway and Vladimir Oleynik to Add CTRL-K
and fix CTRL-L support for cmdedit.c
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r--shell/cmdedit.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 3810c23..b0309fe 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: