Table of Contents
Much of the text and color that the BBS Terminal Server displays (sends to a remote terminal) is stored as strings of text in the
ctrl/text.dat file. The syntax of the
text.dat file is very specific and extreme caution should be taken when editing the file.
Each line of the
text.dat is limited to 255 characters (including comments), while each text string defined in the
text.dat file has a maximum length of 2000 characters.
text.dat string value is defined with a string of ASCII characters between double-quote characters:
"this is an example text.dat string"
Any text after the terminating (ending) double-quote character is ignored when the
text.dat file is parsed by Synchronet. The stock
text.dat file contains helpful numbers and names (comments) after the terminating quotes, but these comments are not actually required.
The content between the double-quotes is mostly just printable ASCII characters, but may also include:
- Ctrl-A codes (e.g. to change the color of the text, if/when supported by the terminal)
- @-codes (e.g. used to perform terminal cursor control or include external content)
- C printf-specifiers (e.g.
%d, used for dynamic variable content)
- C printf escape sequences (e.g.
\n, used for special non-printable characters)
- Mmemonics (e.g. prompts with command keys denoted with a
The syntax of the characters between the double quotations is identical to the C language printf() format string with one exception: \xxx where x are digits (0-9) represents a decimal number, not an octal number. The range is 0 to 255. If you wish to set a background color using \1 for the Ctrl-A code, you may need to pad the attribute number with zeroes. For example; to set the background to blue, you might try to use the sequence “\14” which won't work. You could either embed the actual Ctrl-A character or use “\0014”.
| ||Backslash ('\') character|
| ||Question Mark (not normally necessary)|
| ||Single Quotation Mark|
| ||Double Quotation Mark|
| || Embedded character in hexadecimal notation (
| || Embedded character in decimal notation (
| ||Carriage Return (ASCII 13) character|
| ||Line-feed (ASCII 10) character|
| ||Horizontal Tab (ASCII 9) character|
| ||Backspace (ASCII 8) character|
| ||Alarm/bell (ASCII 7) character|
| ||Form-feed (ASCII 12) character|
| ||Vertical Tab (ASCII 11) character|
See Also: Escape_sequences_in_C
To continue a text string onto the next line of the
text.dat file (e.g. to create long text strings, up to 2000 characters, from multiple shorter lines): place a backslash ('\') character immediately after the terminating double-quote character of each line, except for the last.
The order of the % specifiers (if they exist) in a
text.dat line cannot be
altered. The display of %s specifiers can be suppressed by changing the
%.0s. There are advanced Ctrl-A codes that may also be used for the suppression of text sent to users with an insufficient security level or lacking a security flag.
You can suppress the display of an entire
text.dat line by simply
setting the text to a blank string (
Some of the
text.dat strings have characters preceded by a tilde ('~'). These strings
are referred to as mnemonics. The tilde precedes a character that is to be
highlighted for users supporting ANSI and enclosed in parenthesis for non-ANSI
users. Mnemonics are usually used for prompt strings that contain the valid key commands.
The colors to use for the highlighted characters, normal characters, and the
command character are specified in the
So-called @-codes may be used in many
text.dat lines. With the use of the
EXEC_XTRN @-codes, the text.dat may be enhanced with externally-loaded and potentially dynamically-changing content.
Exception: For security reasons,
text.dat lines that contain %-specifiers may not also include @-codes.
Knowledge of the C programming language may be very helpful in producing the desired results. If all you want to do is change colors of a certain text line, take care not to disturb the arrangement of the other characters on the line. Ctrl-A codes can be preceded by an embedded actual Ctrl-A (ASCII 0x01) character or by a '\1' (the C printf() escape sequence representing a Ctrl-A character).
There are multiple ways to customize the contents of the
- Edit the
text.datfile directly (e.g. using a text editor, but do this with care, see above)
bbs.text function. The caller must pass the number of the text string they wish to obtain.
All of the
text.dat names and numbers can be found in:
- The C header file:
Note: The default (US-English) values of all
text.dat strings are hard-coded into Synchronet (e.g.
libsbbs.so) so if any lines are missing from your
text.dat file or the file itself is missing, the default values will be automatically used.
Make a backup of the
text.dat file before you edit it. If you damage the file
syntax when editing it, Synchronet may execute erroneously or even fail to
The Yes/No prompts in the
text.dat file may by identified by their names (in the comments) which end in a capital
Q (for “Question”). Examples:
These questions may be suppressed (never asked of the user) by changing the corresponding text value to a blank string (i.e.
”“). When suppressed, the default answer to the question will be assumed by the BBS (script or program) and user will never be prompted for an answer to that particular question. The default answer may be “Yes” or “No”, depending on the context of the question.
In many cases,
Q or Ctrl-C (abort) may also be an acceptable answer to the question, but this will never be the default answer.
The default values of all the
text.dat strings are stored in the Synchronet Terminal Server library (
To use all default text strings you can either:
1. Download the
text.dat revision from the Source Repository which correlates with the executables you're using and overwrite your local file, or
2. Replace (overwrite) your
text.dat file with a 0-length file (each 'missing' string is replaced with the default string), e.g. (on *nix):
cp /dev/null /sbbs/ctrl/text.dat