Revert "Change Windows startup"

This reverts commit acb85b18cf.

Some optlist issues arose on some platforms, but not all.
I need to investigate the cause of those.
This commit is contained in:
nhmall
2026-04-05 12:07:57 -04:00
parent acb85b18cf
commit db1f230772
23 changed files with 959 additions and 450 deletions

View File

@@ -156,6 +156,7 @@ static boolean check_font_widths(void);
#endif
static void set_known_good_console_font(void);
static void restore_original_console_font(void);
extern void safe_routines(void);
void tty_ibmgraphics_fixup(void);
#ifdef VIRTUAL_TERMINAL_SEQUENCES
extern void (*ibmgraphics_mode_callback)(void); /* symbols.c */
@@ -1188,6 +1189,8 @@ consoletty_open(int mode UNUSED)
void
consoletty_exit(void)
{
/* go back to using the safe routines */
safe_routines();
free_custom_colors();
free((genericptr_t) console.front_buffer);
free((genericptr_t) console.back_buffer);
@@ -2543,13 +2546,9 @@ void early_raw_print(const char *s)
void nethack_enter_consoletty(void)
{
int width;
#ifdef VIRTUAL_TERMINAL_SEQUENCES
char buf[BUFSZ], *bp, *localestr;
BOOL apisuccess;
// DWORD unused;
// int i = 0;
#endif /* VIRTUAL_TERMINAL_SEQUENCES */
#if 0
/* set up state needed by early_raw_print() */
@@ -2563,38 +2562,13 @@ void nethack_enter_consoletty(void)
GetWindowLong(console.hWnd, GWL_STYLE)
& ~WS_MAXIMIZEBOX & ~WS_SIZEBOX);
#endif
CONSOLE_SCREEN_BUFFER_INFO csbi;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
/* srWindow identifies the visible area; dwSize identifies the buffer
*/
width = csbi.srWindow.Right - csbi.srWindow.Left + 1;
fprintf(stdout, "width = %d\n", width);
}
console.hConOut = GetStdHandle(STD_OUTPUT_HANDLE);
nhassert(console.hConOut != NULL); // NOTE: this assert will not print
GetConsoleScreenBufferInfo(console.hConOut, &console.orig_csbi);
//COORD screencheck = GetLargestConsoleWindowSize(console.hConOut);
GetConsoleMode(console.hConOut, &console.orig_out_cmode);
console.out_cmode = console.orig_out_cmode;
console.out_cmode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(console.hConOut, console.out_cmode);
#if 0
/* tests */
WriteConsoleA(console.hConOut, "\033[8;;133t",9, &unused, NULL);
for (i = 0; i < 13; ++i) {
WriteConsoleA(console.hConOut, "0123456789", 10, &unused, NULL);
}
WriteConsoleA(console.hConOut, "\033[3;133ftest", 12, &unused, NULL);
GetConsoleScreenBufferInfo(console.hConOut, &console.orig_csbi);
/* Testing of widths != COLNO has not turned up any problems. Need
* to do a bit more testing and then we are likely to enable having
* console width match window width.
*/
#endif
#if 0
console.width = console.orig_csbi.srWindow.Right -
console.orig_csbi.srWindow.Left + 1;