pdcurses: don't truncate curses window width

The curses windows were being capped at 110 columns
inappropriately.

Use the full width of the console.
This commit is contained in:
nhmall
2026-05-14 22:40:48 -04:00
parent 2eb817af07
commit 5edb093e14
3 changed files with 33 additions and 4 deletions
+2
View File
@@ -2180,6 +2180,8 @@ void console_g_putch(int in_ch);
extern void set_output_mode(int);
extern void synch_cursor(void);
extern void nethack_enter_consoletty(void);
extern int get_console_width(void);
extern int get_console_height(void);
extern void consoletty_exit(void);
extern int set_keyhandling_via_option(void);
#ifdef ENHANCED_SYMBOLS
+12
View File
@@ -2638,6 +2638,18 @@ void nethack_enter_consoletty(void)
nhUse(apisuccess);
}
int
get_console_width(void)
{
return console.width;
}
int
get_console_height(void)
{
return console.height;
}
RESTORE_WARNING_CONDEXPR_IS_CONSTANT
#endif /* TTY_GRAPHICS */
+19 -4
View File
@@ -761,11 +761,26 @@ curses_init_options(void)
terminal size programmatically. If the user does not specify a
size in the config file, we will set it to a nice big 32x110 to
take advantage of some of the nice features of this windowport. */
if (iflags.wc2_term_cols == 0)
iflags.wc2_term_cols = 110;
if (iflags.wc2_term_rows == 0)
iflags.wc2_term_rows = 32;
if (iflags.wc2_term_cols == 0) {
#ifndef MSWIN_GRAPHICS
int console_width = get_console_width();
if (console_width != 0)
iflags.wc2_term_cols = console_width;
else
#endif
iflags.wc2_term_cols = 110;
}
if (iflags.wc2_term_rows == 0) {
#ifndef MSWIN_GRAPHICS
int console_height = get_console_height();
if (console_height != 0)
iflags.wc2_term_rows = console_height;
else
#endif
iflags.wc2_term_rows = 32;
}
resize_term(iflags.wc2_term_rows, iflags.wc2_term_cols);
getmaxyx(base_term, term_rows, term_cols);