====== Menu Files ======

Menu files displayed to the remote terminal client / user are stored in the ''[[dir:text]]/menu'' directory.

If the //[[dir:mods]]// directory has been configured (in SCFG->System->Advanced Options), menu files may also be stored in the ''[[dir:mods]]/text/menu'' directory and will take precedence.

Menu files that have been translated to alternate languages (represented by ''[[dir:ctrl]]/text.//lang//.ini'' files) are stored in their ''[[dir:text]]/menu///lang//'' directory.

Other display files (mainly used during the terminal server's //new user// registration process), are stored in the ''[[dir:text]]'' directory (or ''[[dir:mods]]/text'' directory).

Menu files may have one of the following file suffixes / extensions:

^Extension       ^Description of expected contents^
|''.asc''        |ASCII characters (CP437 characters, optionally)|
|''.msg''        |ASCII/CP437 characters ((the main difference between .asc and .msg files are their selection priority, with .asc files targeting plain-ASCII terminals)) |
|''.seq''        |PETSCII characters and control-sequences |
|''.ans''        |ASCII/CP437 characters and ANSI X3.64 Terminal control-sequences|
|''.mon''        |ASCII/CP437 characters and ANSI X3.64 Terminal control-sequences suited for monochrome displays |
|''.rip''        |ASCII/CP437 characters and RIPscrip Terminal control-sequences|

//All// of these file types may contain [[Ctrl-A Codes]] color/attribute codes and/or [[atcodes|@-Codes]].

Although you may have multiple menu files with the same base filename and different suffixes/extensions, only one menu file will be selected and displayed to the terminal user based on their configured or auto-detected terminal type/capabilities. The menu/display file selection priority is as follows (the highest-priority file type that exists on disk will be displayed to the user):

|          |^ ANSI / CP437((ANSI/CP437 would be the most common BBS terminal-type encountered))         ^^ ANSI / ASCII       ^|   |||
^ Priority ^     RIP    ^ Color    ^ Mono      ^  Color   ^ Mono     ^  PETSCII  ^ TTY / CP437   ^  TTY / ASCII     ^
| 1        | ''.rip''   | ''.ans'' | ''.mon'' | ''.ans'' | ''.mon''  | ''.seq''  | ''.msg''      | ''.asc''       |
| 2        | ''.ans''   | ''.msg'' | ''.ans'' | ''.asc'' | ''.ans''  | ''.msg''  | ''.asc''      | ''.msg''       |
| 3        | ''.msg''   | ''.asc'' | ''.msg'' | ''.msg'' | ''.asc''  | ''.asc''  |               |                |
| 4        | ''.asc''   |          | ''.asc'' |          | ''.msg''  |           |               |                |

Each of these file types may be preempted by a terminal-width specific file with a name ending in ''.//X//col//.ext//'' where ''//X//'' is the **exact** number of screen columns required to display the file correctly (e.g. 40, 80, 132) and ''//.ext//'' is one of the supported file extensions from the above list. To specify a **minimum** number of screen columns for a display file, use filenames ending in ''.c//X.ext//'' where //X// is the minimum number of screen columns to display the file correctly.

If you only have **one** display file for any particular base filename, it should have either a ''.msg'' or ''.asc'' extension and contain no terminal-control sequences (e.g. ANSI, PETSCII, or RIP).

See the [[https://gitlab.synchro.net/main/sbbs/-/tree/master/text/menu|Menu Directory]] in [[dev:git]] for default menu files and their contents.

Most menu files are loaded/displayed by a [[custom:command shell]], so the name and location (e.g. sub-directory) of those files may depend on which command shell is in use by the users of your [[server:terminal]] server.

===== Defaults =====

Default menu file names and descriptions:

^Base filename ^Displayed By^Description^
|''allmail''       |readmail.cpp|Sysop's reading all mail on system menu|
|''attr''          |writemsg.cpp|Ctrl-A code help for use within the Synchronet internal message editor|
|''batchxfr''      |bat_xfer.cpp|Batch transfer menu|
|''batflag''       |listfile.cpp|Batch flag command key menu|
|''chat''          |chat_sec.js |Chat section menu|
|''e-mail''        |default.src |E-mail section menu|
|''editor''        |writemsg.cpp|Synchronet internal editor commands and line editing keys|
|''exempt''        |useredit.cpp|Exemption flag descriptions for use within User Edit|
|''flags//<x>//''  |useredit.cpp|Flag set (x is 1 through 4) descriptions for use within User Editor (sysop to modify)|
|''logoff''        |execfunc.cpp|Logoff screen (not displayed on fast logoff)|
|''logoninfo''     |logon.cpp   |Brief system and user information displayed during logon((when SCFG->System->Toggles->Display Sys Info During Logon is set to "Yes")) |
|''mailread''      |readmail.cpp|Reading mail menu|
|''main''          |default.src |Main section menu (the most commonly viewed menu)|
|''maincfg''       |default.src |Main configuration menu|
|''maininfo''      |default.src |Main information menu|
|''msgscan''       |scansubs.cpp|Message reading/scanning menu|
|''multchat''      |chat.cpp    |Multinode chat menu|
|''privchat''      |chat.cpp    |Private node-to-node chat menu|
|''qwk''           |qwk.cpp     |QWK Packet configuration and transfer menu|
|''random*''       |logon.js    |Logon screen picked at random, e.g. ''random1'', ''random2'', ''random3'', etc. (see also ''logon//<n>//'')|
|''restrict''      |useredit.cpp|Restriction flag descriptions for use within User Edit (sysop to modify)|
|''sentmail''      |readmail.cpp|Reading sent mail menu|
|''sysmailr''      |readmail.cpp|Sysop additional commands while reading mail|
|''sysmain''       |default.src |Sysop additional commands for main section|
|''sysmscan''      |readmsgs.cpp|Sysop additional commands while message reading/scanning|
|''sysxfer''       |default.src |Sysop additional commands for transfer section|
|''tempxfer''      |tmp_xfer.cpp|Temporary directory commands menu|
|''textsrch''      |prntfile.cpp|[[user:boolean_search|Boolean text-search]] syntax help (displayed when ''%%?%%'' is entered at any "Text to search for" prompt) |
|''transfer''      |default.src |File Transfer section menu|
|''userinfo''      |str.cpp     |User Information (statistics) screen |
|''uedit''         |useredit.cpp|User Edit menu|
|''xfercfg''       |default.src |File Transfer section configuration menu|
|''xferinfo''      |default.src |File Transfer section information menu|

===== Optional =====

Optional menu file names and descriptions (these file do not exist by default):

^Base filename ^Displayed By^Description^
|''batdprot''      |str.cpp     |Batch download transfer protocols (displayed instead of dynamically generated list)|
|''batuprot''      |str.cpp     |Batch upload transfer protocols (displayed instead of dynamically generated list)|
|''dlprot''        |str.cpp     |Download transfer protocols (displayed instead of dynamically generated list)|
|''ulprot''        |str.cpp     |Upload transfer protocols (displayed instead of dynamically generated list)|
|''dirinfo''       |str.cpp     |Information about the current file directory |
|''download''      |str.cpp |Displayed before the transfer protocol selection when downloading file from filebase (v3.20c)|
|''upload''        |shell_lib.js | Displayed before the prompt for user-supplied filename to upload |
|''fileinfo''      |file.cpp    | Displayed when File Information is requested, in place of ''Fi*'' ''[[custom:text.dat]]'' strings (v3.20c)|
|''grps''          |execmsg.cpp |Message Group listing (displayed instead of dynamically generated list)|
|''subs//<x>//''   |execmsg.cpp |Message Sub-board listing, //<x>// is the (one-based) group number|
|''libs''          |execfile.cpp|File Library listing (displayed instead of dynamically generated list)|
|''logon//[n]//''  |logon.js    |Logon screen (logon1, logon2, logon3, etc. also supported), see also ''random*'' |
|''msglist''       | msglist.js|Used by [[module:msglist|Message List]]|
|''msgview''       | msglist.js|Used by [[module:msglist|Message List]]|
|''msgtabs''       |writemsg.cpp|Internal message editor tab bar|
|''dirs//<x>//''   |execfile.cpp|File Directory listing, //<x>// is the (one-based) library number|
|''xtrn_sec_head''        |xtrn_sec.js |External Program Sections header|
|''xtrn_sec''             |xtrn_sec.js |External Program Sections (displayed instead of dynamically generated list)|
|''xtrn_sec_tail''        |xtrn_sec.js |External Program Sections footer|
|''xtrn//<x>//_head''     |xtrn_sec.js |External Program list header, //<x>// is the (one-based) section number|
|''xtrn//<code>//_head''  |xtrn_sec.js |External Program list header, //<code>// is the section code|
|''xtrn_head''            | xtrn_sec.js | External Program list header (global)|
|''xtrn//<x>//''          |xtrn_sec.js |External Program listing, //<x>// is the (one-based) section number|
|''xtrn//<code>//''       |xtrn_sec.js |External Program listing, //<code>// is the section code|
|''xtrn///<code>//''      |xtrn_sec.js|Message displayed just before executing the external program represented by //<code>//|
|''xtrn//<x>//_tail''     |xtrn_sec.js |External Program list footer, //<x>// is the (one-based) section number|
|''xtrn//<code>//_tail''  |xtrn_sec.js |External Program list footer, //<code>// is the section code|
|''xtrn_tail''            | xtrn_sec.js | External Program list footer (global)|
|''sysinfo''       |str.cpp     |Displayed in place of the hard-coded strings (e.g. SiSysName) from ''[[custom:text.dat]]'' in response to user requests for System Information |
|''text_sec''      |text_sec.cpp|Text File Section listing (displayed instead of dynamically generated list)|
|''text//<x>//''   |text_sec.cpp|Text File listing, //<x>// is the (one-based) text file section number|
|''chan''          |chat.cpp    |Multinode Chat Channels (displayed instead of dynamically generated list)|
|''tmessage''      |default.src |Displays when the user enters the transfer section|
|''tpolicy''       |str.cpp     |File transfer policy (displayed instead of ''[[custom:text.dat]]'' strings: TransferPolicyHdr, TpUpload, TpDownload)|
|''subinfo''       |str.cpp     |Information about the current message sub-board |


===== Modifications =====
When modifying a stock display file from the ''[[dir:text]]'' directory (or its ''menu'' sub-directory), a sysop should first copy the file to the ''[[dir:mods]]/text[/menu]'' directory and modify that copy so that their modifications will **not** be overwritten (and thus lost) by a future Synchronet update.

===== See Also =====
  * [[custom:|Customization]]
  * [[custom:Ctrl-A Codes]]
  * [[custom:atcodes|@-Codes]]
  * [[util:ASC2ANS]] utility
  * [[util:ANS2ASC]] utility
  * [[resource:ANSI Editors]]
  * [[dir:text]] directory
  * [[dir:mods]] directory

{{tag>menu ansi customiza}}