Skip to content
Snippets Groups Projects
Commit 7d3305fe authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use configurable default terminal dimensions from sbbs.ini

New (optional) keys in ctrl/sbbs.ini (with defaults):
[BBS]
DefaultTermWidth=80
DefaultTermHeight=24

This fixes issue (feature request) #491
parent b46122f5
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3759 passed
......@@ -86,6 +86,11 @@
FirstNode = 1
LastNode = 4
; Default terminal dimensions, in columns and rows
; For use when unable to auto-detect using ANSI or PET-ports:
DefaultTermWidth = 80
DefaultTermHeight = 24
; Set to a non-zero number to limit the number of concurrent connections from the same client/host
MaxConcurrentConnections = 0
......
......@@ -4154,8 +4154,8 @@ void sbbs_t::reset_logon_vars(void)
menu_dir[0]=0;
menu_file[0]=0;
row = 0;
rows = TERM_ROWS_DEFAULT;
cols = TERM_COLS_DEFAULT;
rows = startup->default_term_height;
cols = startup->default_term_width;
lncntr=0;
autoterm=0;
cterm_version = 0;
......@@ -5510,7 +5510,7 @@ NO_SSH:
sbbs->outcom(0); /* acknowledge RLogin per RFC 1282 */
sbbs->autoterm=0;
sbbs->cols = TERM_COLS_DEFAULT;
sbbs->cols = startup->default_term_width;
SOCKADDR_IN local_addr;
memset(&local_addr, 0, sizeof(local_addr));
socklen_t addr_len=sizeof(local_addr);
......
......@@ -176,7 +176,7 @@ BOOL sbbs_t::newuser()
useron.misc &= ~MOUSE;
}
else
useron.rows = TERM_ROWS_DEFAULT;
useron.rows = startup->default_term_height;
if(useron.misc&PETSCII) {
autoterm |= PETSCII;
......
......@@ -414,6 +414,9 @@ void sbbs_read_ini(
SAFECOPY(bbs->temp_dir
,iniGetString(list,section,strTempDirectory,global->temp_dir,value));
bbs->default_term_width = iniGetUInteger(list, section, "DefaultTermWidth", TERM_COLS_DEFAULT);
bbs->default_term_height = iniGetUInteger(list, section, "DefaultTermHeight", TERM_ROWS_DEFAULT);
/* Set default terminal type to "stock" termcap closest to "ansi-bbs" */
#if defined(__FreeBSD__)
default_term_ansi="cons25";
......@@ -892,6 +895,9 @@ BOOL sbbs_write_ini(
else if(!iniSetString(lp,section,strTempDirectory,bbs->temp_dir,&style))
break;
iniSetUInteger(lp, section, "DefaultTermWidth", bbs->default_term_width, &style);
iniSetUInteger(lp, section, "DefaultTermHeight", bbs->default_term_height, &style);
if(!iniSetString(lp,section,"ExternalTermANSI",bbs->xtrn_term_ansi,&style))
break;
if(!iniSetString(lp,section,"ExternalTermDumb",bbs->xtrn_term_dumb,&style))
......
......@@ -147,6 +147,8 @@ typedef struct {
/* Miscellaneous */
uint max_concurrent_connections;
uint default_term_height;
uint default_term_width;
BOOL usedosemu;
char xtrn_term_ansi[32]; /* external ANSI terminal type (e.g. "ansi-bbs") */
char xtrn_term_dumb[32]; /* external dumb terminal type (e.g. "dumb") */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment