diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-12-21 11:20:15 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-12-21 11:20:15 +0000 |
commit | e585966eb46a3927805472c9f2f76941bd7b41f1 (patch) | |
tree | f194c5ec836be72e183fb3f716b2232ad53558a6 /shell | |
parent | d9ecb945d4d7324f64aaf334268ec1cfaa78c502 (diff) | |
download | busybox-w32-e585966eb46a3927805472c9f2f76941bd7b41f1.tar.gz busybox-w32-e585966eb46a3927805472c9f2f76941bd7b41f1.tar.bz2 busybox-w32-e585966eb46a3927805472c9f2f76941bd7b41f1.zip |
Patch from vodz to implement ^L (clear screen)
git-svn-id: svn://busybox.net/trunk/busybox@3935 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c index b90891587..d4d6264d0 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c | |||
@@ -1263,6 +1263,16 @@ prepare_to_die: | |||
1263 | input_tab(&lastWasTab); | 1263 | input_tab(&lastWasTab); |
1264 | #endif | 1264 | #endif |
1265 | break; | 1265 | break; |
1266 | case 12: | ||
1267 | /* Control-l -- clear screen | ||
1268 | * if the len=0 and no chars in edit line */ | ||
1269 | if (len == 0) { | ||
1270 | printf("\033[H\033[J"); | ||
1271 | put_prompt(); | ||
1272 | } else { | ||
1273 | beep(); | ||
1274 | } | ||
1275 | break; | ||
1266 | case 14: | 1276 | case 14: |
1267 | /* Control-n -- Get next command in history */ | 1277 | /* Control-n -- Get next command in history */ |
1268 | if (hp && hp->n && hp->n->s) { | 1278 | if (hp && hp->n && hp->n->s) { |
@@ -1288,7 +1298,6 @@ prepare_to_die: | |||
1288 | redraw(cmdedit_y, len -= cursor); | 1298 | redraw(cmdedit_y, len -= cursor); |
1289 | } | 1299 | } |
1290 | break; | 1300 | break; |
1291 | |||
1292 | case ESC:{ | 1301 | case ESC:{ |
1293 | /* escape sequence follows */ | 1302 | /* escape sequence follows */ |
1294 | if (safe_read(0, &c, 1) < 1) | 1303 | if (safe_read(0, &c, 1) < 1) |