X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=compat%2Fwinansi.c;h=44dc293ad314379d7835d9d96a5c3fd12ad2b27f;hb=95a877a34c3838a92a99794ebc3b082f6f525899;hp=e2d96dfe6f75213de567174261d9aeba3e663d9d;hpb=ed56049058284d7df2ede1ce5f494a2a9a109479;p=git.git diff --git a/compat/winansi.c b/compat/winansi.c index e2d96dfe6..44dc293ad 100644 --- a/compat/winansi.c +++ b/compat/winansi.c @@ -18,8 +18,6 @@ This file is git-specific. Therefore, this file does not attempt to implement any codes that are not used by git. - - TODO: K */ static HANDLE console; @@ -79,6 +77,20 @@ static void set_console_attr(void) SetConsoleTextAttribute(console, attributes); } +static void erase_in_line(void) +{ + CONSOLE_SCREEN_BUFFER_INFO sbi; + + if (!console) + return; + + GetConsoleScreenBufferInfo(console, &sbi); + FillConsoleOutputCharacterA(console, ' ', + sbi.dwSize.X - sbi.dwCursorPosition.X, sbi.dwCursorPosition, + NULL); +} + + static const char *set_attr(const char *str) { const char *func; @@ -218,7 +230,7 @@ static const char *set_attr(const char *str) set_console_attr(); break; case 'K': - /* TODO */ + erase_in_line(); break; default: /* Unsupported code */