Patch from Jim Treadway and Vladimir Oleynik to Add CTRL-K

and fix CTRL-L support for cmdedit.c
This commit is contained in:
Eric Andersen
2002-04-13 13:26:49 +00:00
parent 3e6908b586
commit 65a0730c9f

View File

@ -1263,14 +1263,18 @@ prepare_to_die:
input_tab(&lastWasTab); input_tab(&lastWasTab);
#endif #endif
break; break;
case 12: case 11:
/* Control-l -- clear screen /* Control-k -- clear to end of line */
* if the len=0 and no chars in edit line */ *(command + cursor) = 0;
if (len == 0) { len = cursor;
printf("\033[H\033[J"); redraw(cmdedit_y, 0);
put_prompt(); break;
} else { case 12:
beep(); {
/* Control-l -- clear screen */
int old_cursor = cursor;
printf("\033[H");
redraw(0, len-old_cursor);
} }
break; break;
case 14: case 14: