diff options
author | Ron Yorston <rmy@pobox.com> | 2016-04-25 14:48:10 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2016-04-25 14:48:10 +0100 |
commit | 9a7f488564610817a7b9d9d44d7db154e444eb7d (patch) | |
tree | bfeff35337530535c3aeac652eae4bbe160a88d8 | |
parent | ad85fec9f3c913b2a8cafb24900966b13dc7fc5c (diff) | |
download | busybox-w32-9a7f488564610817a7b9d9d44d7db154e444eb7d.tar.gz busybox-w32-9a7f488564610817a7b9d9d44d7db154e444eb7d.tar.bz2 busybox-w32-9a7f488564610817a7b9d9d44d7db154e444eb7d.zip |
winansi: fix a couple of small problems
Clear the last line; move to cursor position before clearing screen
with ^L.
-rw-r--r-- | libbb/lineedit.c | 3 | ||||
-rw-r--r-- | win32/winansi.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 04361b509..37c106bd8 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -2510,6 +2510,9 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2510 | case CTRL('L'): | 2510 | case CTRL('L'): |
2511 | vi_case(CTRL('L')|VI_CMDMODE_BIT:) | 2511 | vi_case(CTRL('L')|VI_CMDMODE_BIT:) |
2512 | /* Control-l -- clear screen */ | 2512 | /* Control-l -- clear screen */ |
2513 | #if ENABLE_PLATFORM_MINGW32 | ||
2514 | printf(ESC"[0A"); /* move to current cursor postion */ | ||
2515 | #endif | ||
2513 | printf(ESC"[H"); /* cursor to top,left */ | 2516 | printf(ESC"[H"); /* cursor to top,left */ |
2514 | redraw(0, command_len - cursor); | 2517 | redraw(0, command_len - cursor); |
2515 | break; | 2518 | break; |
diff --git a/win32/winansi.c b/win32/winansi.c index d9e0835ce..78d5d5f5c 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -124,7 +124,8 @@ static void erase_till_end_of_screen(void) | |||
124 | &dummy); | 124 | &dummy); |
125 | 125 | ||
126 | pos.X = 0; | 126 | pos.X = 0; |
127 | for (pos.Y = sbi.dwCursorPosition.Y+1; pos.Y < sbi.srWindow.Bottom; pos.Y++) { | 127 | for (pos.Y = sbi.dwCursorPosition.Y+1; pos.Y <= sbi.srWindow.Bottom; |
128 | pos.Y++) { | ||
128 | FillConsoleOutputCharacterA(console, ' ', sbi.dwSize.X, | 129 | FillConsoleOutputCharacterA(console, ' ', sbi.dwSize.X, |
129 | pos, &dummy); | 130 | pos, &dummy); |
130 | FillConsoleOutputAttribute(console, plain_attr, sbi.dwSize.X, | 131 | FillConsoleOutputAttribute(console, plain_attr, sbi.dwSize.X, |