Patch from vodz to implement ^L (clear screen)

This commit is contained in:
Eric Andersen 2001-12-21 11:20:15 +00:00
parent 9910cd2869
commit f1f2bd0b0a

View File

@ -1263,6 +1263,16 @@ prepare_to_die:
input_tab(&lastWasTab); input_tab(&lastWasTab);
#endif #endif
break; 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: case 14:
/* Control-n -- Get next command in history */ /* Control-n -- Get next command in history */
if (hp && hp->n && hp->n->s) { if (hp && hp->n && hp->n->s) {
@ -1288,7 +1298,6 @@ prepare_to_die:
redraw(cmdedit_y, len -= cursor); redraw(cmdedit_y, len -= cursor);
} }
break; break;
case ESC:{ case ESC:{
/* escape sequence follows */ /* escape sequence follows */
if (safe_read(0, &c, 1) < 1) if (safe_read(0, &c, 1) < 1)