This is an old revision of the document!


Ctrl-A Codes

“Control A” codes (a.k.a. ^A codes) are terminal control sequences embedded in Synchronet text and menu display files.

Background

Ctrl-A codes are primarily used in place of ANSI X3.64 terminal escape sequences to control terminal text attribute (e.g. color) combinations and perform some cursor positioning and other advanced features (not available with ANSI escape sequences).

The advantage that Ctrl-A codes have over ANSI escape sequences is that they are easily stripped out or converted by the Terminal Server of the BBS software to automatically meet the capabilities of the remote user's terminal. There are additional capabilities in Ctrl-A codes that go beyond the realm of terminal control and ANSI escape sequences.

The Ctrl-A character was chosen because it's a control character not often found in displayable text files or expected to be rendered in a consistent manner on all terminals. And “A” is for “Attribute”. :-)

Ctrl-A codes may be included in most text files displayed to users of the Synchronet Terminal Server as well as messages posted in message bases, extended file descriptions, and other places where some colored text can give users the opportunity to better express themselves.

Use

Ctrl-A codes are 2-character sequences which begin with a Ctrl-A (ASCII 1) character (hence the name) and are followed by a single character (case insensitive) which determines the operation to be performed. The only exception to this 2-character sequences is the Ctrl-Afilename code, which takes a filename as an argument and the filename is considered part of the sequence and not displayed.

It can sometimes require a special purpose text editor to actually enter a Ctrl-A character into a text file. Some editors may require a special key sequence or use of a menu option to enter a Ctrl-A character into a file. The graphical representation of the character may be a happy face or any other non-alphanumeric symbol that the editor chooses to render to represent that character code. There are @-Codes for the equivalent of many of the Ctrl-A codes, so may consider using them if they are more convenient for your text editor of choice.

In the text.dat and possibly some other files, Ctrl-A characters may be entered using the C escape sequence: \1.

The ANS2ASC utility may be used to convert files encoded with ANSI X3.64 terminal escape sequences (e.g. *.ans) into Ctrl-A encoded output and the ASC2ANS utility can be used to perform the opposite operation (useful for editing Ctrl-A encoded files (e.g. *.msg or *.asc) with an ANSI-BBS screen editor).

Colors

The following table is a list of Color Ctrl-A codes and their purpose:

Color ForegroundBackground
Black K 0
Red R 1
Green G 2
Yellow Y 3
Blue B 4
Magenta M 5
Cyan C 6
White W 7

Attributes

The following table is a list of Attribute Ctrl-A codes, and a brief description of each code's usage:

Attribute Code Description
High H High Intensity (bright)
Blink I Blinking
Normal N No Special Attributes (Normal)
Optimized Normal - Only sends sequence if High Intensity, Blinking, or Background attribute is set (or pop attributes if pushed)
Optimized Normal _ Only sends sequence if Blinking or Background attribute is set

Control

The following table is a list of Terminal Control Ctrl-A codes, and a brief description of each code's usage:

Operation Code Description
Pause P Display a Pause (Hit a key) Prompt
Pause Reset Q Reset the line counter for the auto screen-pause
Delay , Delay for one tenth of a second
Delay ; Delay for one half second
Delay . Delay for two seconds
Cls L Clear the screen
Home ` Home the cursor
Clreos J Clear to end of screen (leave cursor in current position)
Clreol > Clear to end of line (leave cursor in current position)
Bckspc < Send a non-destructive backspace character (Ctrl-H) - Cursor Left
CR [ Send a carriage return character (Ctrl-M) - Cursor to Beginning of Line
LF ] Send a line feed character (Ctrl-J) - Cursor Down
Push Attr + Save current attributes into attribute LIFO stack
Pop Attr - Restore attributes from stack (or Optimized Normal, if no attributes saved/pushed)
Cursor Right 128-255 Move cursor to the right (code-127) characters

Macros

The following table is a list of Macro Ctrl-A codes, and a brief description of each code's usage:

Macro Code Description
Date D Display the current system date (in “MM/DD/YY” or “DD/MM/YY” format)
Time T Display the current system time (in “HH:MM am” or “HH:MM:SS” format)
Ctrl-A A Send an actual Ctrl-A (ASCII 1) character

Advanced

The following table is a list of Advanced Ctrl-A codes, and a brief description of each code's usage:

Operation Code Description
Sync S Synchronize output with remote system
EOF Z End of displayable text in this file
Embed File "filename Display contents of filename from your text directory

Security

Synchronet also supports Ctrl-A codes used to hide text from users not meeting certain security criteria (i.e.: Security Level or Flags from Flag Set #1).

The following table is a list of Security Ctrl-A codes, and a brief description of each code's usage:

Code Description
Ctrl-A thru Ctrl-ZOnly display the following text to users with the corresponding flag A through Z turned on (from Flag Set #1)
!Toggle the text display off/on for users of less than level 10
@Toggle the text display off/on for users of less than level 20
#Toggle the text display off/on for users of less than level 30
$Toggle the text display off/on for users of less than level 40
%Toggle the text display off/on for users of less than level 50
^Toggle the text display off/on for users of less than level 60
&Toggle the text display off/on for users of less than level 70
*Toggle the text display off/on for users of less than level 80
(Toggle the text display off/on for users of less than level 90
)Restore the displaying of text to ALL users

See Also

custom/ctrl-a_codes.1481009080.txt · Last modified: 2016/12/05 23:24 by digital man
Back to top
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0