Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
winansi: support ESC [ K (erase in line)
author
Johannes Schindelin
<johannes.schindelin@gmx.de>
Tue, 10 Mar 2009 21:58:09 +0000
(22:58 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 11 Mar 2009 06:23:02 +0000
(23:23 -0700)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/winansi.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
34df8ab
)
diff --git
a/compat/winansi.c
b/compat/winansi.c
index e2d96dfe6f75213de567174261d9aeba3e663d9d..44dc293ad314379d7835d9d96a5c3fd12ad2b27f 100644
(file)
--- 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.
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;
*/
static HANDLE console;
@@
-79,6
+77,20
@@
static void set_console_attr(void)
SetConsoleTextAttribute(console, attributes);
}
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;
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':
set_console_attr();
break;
case 'K':
- /* TODO */
+ erase_in_line();
break;
default:
/* Unsupported code */
break;
default:
/* Unsupported code */