Ctrl-L clears the KDL screen.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25233 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-04-29 01:24:41 +00:00
parent bcf291ed9b
commit a1587d16d5
3 changed files with 31 additions and 0 deletions
+8
View File
@@ -595,6 +595,14 @@ blue_screen_enter(bool debugOutput)
} }
void
blue_screen_clear_screen(void)
{
sModule->clear(sScreen.attr);
move_cursor(0, 0);
}
char char
blue_screen_getchar(void) blue_screen_getchar(void)
{ {
+1
View File
@@ -16,6 +16,7 @@ extern "C" {
status_t blue_screen_init(void); status_t blue_screen_init(void);
status_t blue_screen_enter(bool debugOutput); status_t blue_screen_enter(bool debugOutput);
void blue_screen_clear_screen(void);
char blue_screen_getchar(void); char blue_screen_getchar(void);
void blue_screen_putchar(char c); void blue_screen_putchar(char c);
void blue_screen_puts(const char *text); void blue_screen_puts(const char *text);
+22
View File
@@ -376,6 +376,28 @@ read_line(char *buffer, int32 maxLength,
length = position; length = position;
} }
break; break;
case 0x1f & 'L': // CTRL-L -- clear screen
if (sBlueScreenOutput) {
// All the following needs to be transparent for the
// serial debug output. I.e. after clearing the screen
// we have to get the on-screen line into the visual state
// it should have.
// clear screen
blue_screen_clear_screen();
// reprint line
buffer[length] = '\0';
blue_screen_puts(kKDLPrompt);
blue_screen_puts(buffer);
// reposition cursor
if (position < length) {
for (int i = length; i > position; i--)
blue_screen_puts("\x1b[1D");
}
}
break;
case 27: // escape sequence case 27: // escape sequence
c = readChar(); c = readChar();
if (c != '[') { if (c != '[') {