diff options
author | Eric Andersen | 2001-12-21 11:20:15 +0000 |
---|---|---|
committer | Eric Andersen | 2001-12-21 11:20:15 +0000 |
commit | f1f2bd0b0a244afc07cfd602a6357efaebf844e3 (patch) | |
tree | f194c5ec836be72e183fb3f716b2232ad53558a6 /shell | |
parent | 9910cd2869fe90695e99e7be671ac774a78e8101 (diff) | |
download | busybox-f1f2bd0b0a244afc07cfd602a6357efaebf844e3.zip busybox-f1f2bd0b0a244afc07cfd602a6357efaebf844e3.tar.gz |
Patch from vodz to implement ^L (clear screen)
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 b908915..d4d6264 100644 --- a/shell/cmdedit.c +++ b/shell/cmdedit.c @@ -1263,6 +1263,16 @@ 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(); + } + break; case 14: /* Control-n -- Get next command in history */ if (hp && hp->n && hp->n->s) { @@ -1288,7 +1298,6 @@ prepare_to_die: redraw(cmdedit_y, len -= cursor); } break; - case ESC:{ /* escape sequence follows */ if (safe_read(0, &c, 1) < 1) |