diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-03-17 18:58:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-17 18:58:25 -0700 |
commit | 6e5660a7ab20275d80262d0a21bc6c52eead9cd7 (patch) | |
tree | bb08b057a189b014f108f926c3caa217837cf28d /compat | |
parent | 9e6433a21033ed55d0d53aa9fa2ac50057ce91ac (diff) | |
parent | 1897713fbd96229f3581b8e8a5653da917882195 (diff) | |
download | git-6e5660a7ab20275d80262d0a21bc6c52eead9cd7.tar.gz |
Merge branch 'js/sideband-stderr'
* js/sideband-stderr:
winansi: support ESC [ K (erase in line)
recv_sideband: Bands #2 and #3 always go to stderr
Diffstat (limited to 'compat')
-rw-r--r-- | compat/winansi.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/compat/winansi.c b/compat/winansi.c index e2d96dfe6f..44dc293ad3 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 */ |