diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-04-13 13:26:49 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2002-04-13 13:26:49 +0000 |
commit | 28607cb007b0a35321746425d54e8b9ef9a0f227 (patch) | |
tree | d5f4729393ab6f394234b99762aed7527b97dffe /shell | |
parent | 040f25a6ad6ebadd3d4219c05346286b6367edf9 (diff) | |
download | busybox-w32-28607cb007b0a35321746425d54e8b9ef9a0f227.tar.gz busybox-w32-28607cb007b0a35321746425d54e8b9ef9a0f227.tar.bz2 busybox-w32-28607cb007b0a35321746425d54e8b9ef9a0f227.zip |
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
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 20 |
1 files changed, 12 insertions, 8 deletions
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: | |||
1263 | input_tab(&lastWasTab); | 1263 | input_tab(&lastWasTab); |
1264 | #endif | 1264 | #endif |
1265 | break; | 1265 | break; |
1266 | case 12: | 1266 | case 11: |
1267 | /* Control-l -- clear screen | 1267 | /* Control-k -- clear to end of line */ |
1268 | * if the len=0 and no chars in edit line */ | 1268 | *(command + cursor) = 0; |
1269 | if (len == 0) { | 1269 | len = cursor; |
1270 | printf("\033[H\033[J"); | 1270 | redraw(cmdedit_y, 0); |
1271 | put_prompt(); | 1271 | break; |
1272 | } else { | 1272 | case 12: |
1273 | beep(); | 1273 | { |
1274 | /* Control-l -- clear screen */ | ||
1275 | int old_cursor = cursor; | ||
1276 | printf("\033[H"); | ||
1277 | redraw(0, len-old_cursor); | ||
1274 | } | 1278 | } |
1275 | break; | 1279 | break; |
1276 | case 14: | 1280 | case 14: |