initializer fix for !VIRTUAL_TERMINAL_SEQUENCES
For windows sys/windows/consoletty.c. Resolves #1169
This commit is contained in:
+16
-34
@@ -186,15 +186,8 @@ struct console_t {
|
|||||||
WCHAR cpMap[256];
|
WCHAR cpMap[256];
|
||||||
boolean font_changed;
|
boolean font_changed;
|
||||||
CONSOLE_FONT_INFOEX orig_font_info;
|
CONSOLE_FONT_INFOEX orig_font_info;
|
||||||
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
|
||||||
UINT original_code_page;
|
|
||||||
} console = {
|
|
||||||
0,
|
|
||||||
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED),
|
|
||||||
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED),
|
|
||||||
NO_COLOR,
|
|
||||||
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
|
||||||
UINT orig_code_page;
|
UINT orig_code_page;
|
||||||
|
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
char *orig_localestr;
|
char *orig_localestr;
|
||||||
DWORD orig_in_cmode;
|
DWORD orig_in_cmode;
|
||||||
DWORD orig_out_cmode;
|
DWORD orig_out_cmode;
|
||||||
@@ -205,33 +198,17 @@ struct console_t {
|
|||||||
DWORD out_cmode;
|
DWORD out_cmode;
|
||||||
long color24;
|
long color24;
|
||||||
int color256idx;
|
int color256idx;
|
||||||
|
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
|
||||||
} console = {
|
} console = {
|
||||||
FALSE,
|
FALSE, /* is_ready */
|
||||||
0,
|
0, /* hWnd */
|
||||||
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED), /* background */
|
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED), /* background */
|
||||||
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED), /* foreground */
|
(FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED), /* foreground */
|
||||||
0, /* attr */
|
0, /* attr */
|
||||||
0, /* current_nhcolor */
|
0, /* current_nhcolor */
|
||||||
0, /* current_nhbkcolor */
|
0, /* current_nhbkcolor */
|
||||||
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
|
|
||||||
{FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
|
{FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE},
|
||||||
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
{0, 0}, /* cursor */
|
||||||
{0, 0},
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
{ 0 },
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
FALSE,
|
|
||||||
0,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
{ 0 },
|
|
||||||
FALSE,
|
|
||||||
{ 0 },
|
|
||||||
0
|
|
||||||
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
|
||||||
{ 0, 0 }, /* cursor */
|
|
||||||
NULL, /* hConOut*/
|
NULL, /* hConOut*/
|
||||||
NULL, /* hConIn */
|
NULL, /* hConIn */
|
||||||
{ 0 }, /* cbsi */
|
{ 0 }, /* cbsi */
|
||||||
@@ -245,6 +222,7 @@ struct console_t {
|
|||||||
FALSE, /* font_changed */
|
FALSE, /* font_changed */
|
||||||
{ 0 }, /* orig_font_info */
|
{ 0 }, /* orig_font_info */
|
||||||
0U, /* orig_code_page */
|
0U, /* orig_code_page */
|
||||||
|
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
NULL, /* orig_localestr */
|
NULL, /* orig_localestr */
|
||||||
0, /* orig_in_cmode */
|
0, /* orig_in_cmode */
|
||||||
0, /* orig_out_cmode */
|
0, /* orig_out_cmode */
|
||||||
@@ -1446,8 +1424,6 @@ g_putch(int in_ch)
|
|||||||
buffer_write(console.back_buffer, &cell, console.cursor);
|
buffer_write(console.back_buffer, &cell, console.cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
|
||||||
#ifdef UTF8_FROM_CORE
|
|
||||||
/*
|
/*
|
||||||
* Overrides wintty.c function of the same name
|
* Overrides wintty.c function of the same name
|
||||||
* for win32. It is used for glyphs only, not text and
|
* for win32. It is used for glyphs only, not text and
|
||||||
@@ -1458,6 +1434,8 @@ g_putch(int in_ch)
|
|||||||
void
|
void
|
||||||
g_pututf8(uint8 *sequence)
|
g_pututf8(uint8 *sequence)
|
||||||
{
|
{
|
||||||
|
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
|
#ifdef UTF8_FROM_CORE
|
||||||
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
||||||
cell_t cell;
|
cell_t cell;
|
||||||
cell.attr = console.attr;
|
cell.attr = console.attr;
|
||||||
@@ -1468,23 +1446,27 @@ g_pututf8(uint8 *sequence)
|
|||||||
Snprintf((char *) cell.utf8str, sizeof cell.utf8str, "%s",
|
Snprintf((char *) cell.utf8str, sizeof cell.utf8str, "%s",
|
||||||
(char *) sequence);
|
(char *) sequence);
|
||||||
buffer_write(console.back_buffer, &cell, console.cursor);
|
buffer_write(console.back_buffer, &cell, console.cursor);
|
||||||
}
|
|
||||||
#endif /* UTF8_FROM_CORE */
|
#endif /* UTF8_FROM_CORE */
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_start_24bitcolor(struct unicode_representation *uval)
|
term_start_24bitcolor(struct unicode_representation *uval)
|
||||||
{
|
{
|
||||||
|
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
console.color24 = uval->ucolor; /* color 0 has bit 0x1000000 set */
|
console.color24 = uval->ucolor; /* color 0 has bit 0x1000000 set */
|
||||||
console.color256idx = uval->u256coloridx;
|
console.color256idx = uval->u256coloridx;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_end_24bitcolor(void)
|
term_end_24bitcolor(void)
|
||||||
{
|
{
|
||||||
|
#ifdef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
console.color24 = 0L;
|
console.color24 = 0L;
|
||||||
console.color256idx = 0;
|
console.color256idx = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
cl_end(void)
|
cl_end(void)
|
||||||
@@ -2210,7 +2192,7 @@ set_known_good_console_font(void)
|
|||||||
console.font_changed = TRUE;
|
console.font_changed = TRUE;
|
||||||
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
console.orig_font_info = console_font_info;
|
console.orig_font_info = console_font_info;
|
||||||
console.original_code_page = GetConsoleOutputCP();
|
console.orig_code_page = GetConsoleOutputCP();
|
||||||
|
|
||||||
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
||||||
console.code_page = GetConsoleOutputCP();
|
console.code_page = GetConsoleOutputCP();
|
||||||
@@ -2245,7 +2227,7 @@ restore_original_console_font(void)
|
|||||||
BOOL success;
|
BOOL success;
|
||||||
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
#ifndef VIRTUAL_TERMINAL_SEQUENCES
|
||||||
raw_print("Restoring original font and code page\n");
|
raw_print("Restoring original font and code page\n");
|
||||||
success = SetConsoleOutputCP(console.original_code_page);
|
success = SetConsoleOutputCP(console.orig_code_page);
|
||||||
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
#else /* VIRTUAL_TERMINAL_SEQUENCES */
|
||||||
if (wizard)
|
if (wizard)
|
||||||
raw_print("Restoring original font, code page and locale\n");
|
raw_print("Restoring original font, code page and locale\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user