Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ref:cterm [2024/02/09 22:27] – Bump git rev deuce | ref:cterm [2024/09/25 23:16] (current) – The wiki sucked... link to new asciidoctor generated page. deuce | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== CTerm ====== | ====== CTerm ====== | ||
- | CTerm is the ANSI parsing code maintained as part of ciolib (and used by SyncTERM). | + | CTerm is the ANSI parsing code maintained as part of ciolib (and used by SyncTERM). |
- | + | ||
- | The text file is still the normative reference, but this may serve as a friendlier source. | + | |
- | + | ||
- | ===== CTerm terminal characteristics ===== | + | |
- | + | ||
- | ==== End of line behaviour (wrapping) ==== | + | |
- | + | ||
- | The cursor is moved to the first character of the next line as soon as a character is written to the last column of the current line, not on the next character. | + | |
- | + | ||
- | There are two settable flags that will impact the default behaviour. | + | |
- | + | ||
- | '' | + | |
- | + | ||
- | If the '' | + | |
- | + | ||
- | Specifically, | + | |
- | '' | + | |
- | + | ||
- | ===== Control Characters ===== | + | |
- | + | ||
- | ^ Name ^ Hex ^ Description ^ | + | |
- | | NUL | '' | + | |
- | | BEL | '' | + | |
- | | BS | '' | + | |
- | | HT | '' | + | |
- | | LF | '' | + | |
- | | CR | '' | + | |
- | | ESC | '' | + | |
- | + | ||
- | ===== Control Codes ===== | + | |
- | + | ||
- | Control codes are in the following format: | + | |
- | '' | + | |
- | + | ||
- | ^ Mnemonic ^ Name ^ Sequence | + | |
- | | NEL | Next Line | '' | + | |
- | | HTS | Set Tab | '' | + | |
- | | RI | Reverse Line Feed | '' | + | |
- | | DCS | Device Control String | + | |
- | | SOS | Start of String | + | |
- | | CSI | Control Sequence Introducer | '' | + | |
- | | ST | String Terminator | + | |
- | | OSC | Operating System Command | + | |
- | | PM | Privacy Message | + | |
- | | APS | Application Program String | + | |
- | | RIS | Reset to Initial State | '' | + | |
- | + | ||
- | ==== Supported DCS string values ==== | + | |
- | === CTerm loadable font === | + | |
- | **Sequence: | + | |
- | Indicates the string is a loadable font. (CTerm 1.213) | + | |
- | + | ||
- | p1 is a font slot number, which must be higher than the last default defined font (See CSI sp D for list of predefined fonts). <b64> is the base64 encoded font data. Font size is deduced from the size of the data. This replaces the now deprecated '' | + | |
- | + | ||
- | === Sixel Sequence === | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Indicates the string is a sixel sequence. | + | |
- | + | ||
- | p1 selects the vertical height of a single pixel. | + | |
- | + | ||
- | Supported values | + | |
- | ^ Value ^ Vertical Size ^ | + | |
- | | 0,1,5,6 | 2 pixels | + | |
- | | 2 | 5 pixels | + | |
- | | 3,4 | 3 pixels | + | |
- | | 7,8,9 | 1 pixel | | + | |
- | + | ||
- | p2 indicates if unset sixels should be set to the current background colour. | + | |
- | + | ||
- | Any additional parameters are ignored. | + | |
- | + | ||
- | The rest of the string is made up of sixel data characters and sixel control functions. | + | |
- | + | ||
- | == Sixel Control Functions == | + | |
- | ^ String | + | |
- | | '' | + | |
- | | '' | + | |
- | | ''# | + | |
- | | ''# | + | |
- | | '' | + | |
- | | '' | + | |
- | + | ||
- | === Request Status String (DECRQSS) === | + | |
- | **Sequence: | + | |
- | pt is the intermediate and/or final characters of a control function to query the status of. The terminal will send a response in the format '' | + | |
- | + | ||
- | p1 is 1 if the terminal supports querying the control function and 0 if it does not. | + | |
- | + | ||
- | pt is the characters in the control function except the CSI characters. | + | |
- | + | ||
- | Currently supported values of p1: | + | |
- | ^ Value ^ Description ^ | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | + | ||
- | === Define Macro (DECDMAC) === | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets a macro to be replayed using '' | + | |
- | + | ||
- | p1 is the macro number to set, and make be between 0 and 63 inclusive. | + | |
- | + | ||
- | If p2 is zero, the macro numbered p1 will be deleted. If p2 is one, all macros are deleted. | + | |
- | + | ||
- | If p3 is zero, the macro is defined using ASCII characters (0x20 - 0x7e and 0xa0 - 0xff only) if p3 is one, the macro is defined using hex pairs. | + | |
- | + | ||
- | When the macro is defined using hex pairs, a repeat sequence may be included in the format of '' | + | |
- | + | ||
- | ==== Supported OSC string values ==== | + | |
- | + | ||
- | === Palette Redefinition === | + | |
- | **Sequence: | + | |
- | Specifies one or more palette redefinitions. pX is the palette index, and pY is the colour definition | + | |
- | Color format: '' | + | |
- | + | ||
- | ==== Supported APS string values ==== | + | |
- | + | ||
- | SyncTERM | + | |
- | + | ||
- | === Store File === | + | |
- | **Sequence: | + | |
- | Where Ps1 is a filename and Ps2 is the base64 encoded contents of the file. The named file is stored in the cache directory for the current connection. | + | |
- | + | ||
- | === List Files in Cache === | + | |
- | **Sequence: | + | |
- | List files in cache. | + | |
- | + | ||
- | And additional argument can be specified as a glob(3) pattern (defaults to " | + | |
- | + | ||
- | === Set Font === | + | |
- | **Sequence: | + | |
- | Where Pn is a font slot number (max 255) and Ps is a filename in the cache. | + | |
- | + | ||
- | === Draw PPM === | + | |
- | **Sequence: | + | |
- | Draws a PPM from the cache directory on the screen. Ps2 is the filename and is required. | + | |
- | + | ||
- | ^ Option | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | + | ||
- | The PPM file may be raw (preferred) or text. SyncTERM does not support more than 255 values per colour channel and assumes it is correctly using the BT.709 gamma transfer. | + | |
- | + | ||
- | === Load PPM === | + | |
- | **Sequence: | + | |
- | Loads a PPM to a buffer. | + | |
- | | '' | + | |
- | + | ||
- | === Load PBM === | + | |
- | **Sequence: | + | |
- | Loads a PBM to a buffer. | + | |
- | + | ||
- | === Copy === | + | |
- | **Sequence: | + | |
- | Copies a portion of the screen into an internal buffer for use with the Paste function. | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | + | ||
- | === Paste === | + | |
- | **Sequence: | + | |
- | Pastes from the copied buffer. | + | |
- | | '' | + | |
- | + | ||
- | ===== Control Sequences ===== | + | |
- | Control sequences are in the following format: | + | |
- | '' | + | |
- | There may be multiple characters from the {' | + | |
- | + | ||
- | Legal combinations not handled are silently dropped. | + | |
- | Illegal combinations are displayed. | + | |
- | + | ||
- | ==== Sequence Parameters ==== | + | |
- | Parameters are expressed by the {' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | | '' | + | |
- | + | ||
- | If a default is defined, the parameter is optional | + | |
- | + | ||
- | ==== Insert Character(s) (ICH) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves text from the current position to the right edge '' | + | |
- | + | ||
- | ==== Scroll Left (SL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Shifts the contents of the screen left Pn columns(s) with leftmost columns going off-screen and the resulting hole being filled with the current attribute. | + | |
- | + | ||
- | ==== Cursor Up (CUU) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position up Pn lines from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Scroll Right (SR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Shifts the contents of the screen right Pn columns(s) with rightmost columns going off-screen and the resulting hole being filled with the current attribute. | + | |
- | + | ||
- | ==== Cursor Down (CUD) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position down Pn lines from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Cursor Right (CUF) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position right Pn columns from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Cursor Left (CUB) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position left Pn columns from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Font Selection (FNT) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets font Ps1 to be the one indicated by Ps2. Currently four fonts are supported. | + | |
- | + | ||
- | Supported Ps1 values: | + | |
- | | 0 | Default font | | + | |
- | | 1 | Font selected by the high intensity bit when '' | + | |
- | | 2 | Font selected by the blink intensity bit when '' | + | |
- | | 3 | Font selected by both the high intensity and blink bits when both CSI ? 31 h and CSI ? 34 h are enabled| | + | |
- | + | ||
- | Currently included fonts are: | + | |
- | | 0 | Codepage 437 English | | + | |
- | | 1 | Codepage 1251 Cyrillic, (swiss) | | + | |
- | | 2 | Russian koi8-r | | + | |
- | | 3 | ISO-8859-2 Central European | | + | |
- | | 4 | ISO-8859-4 Baltic wide (VGA 9bit mapped) | | + | |
- | | 5 | Codepage 866 (c) Russian | | + | |
- | | 6 | ISO-8859-9 Turkish | | + | |
- | | 7 | haik8 codepage (use only with armscii8 screenmap) | | + | |
- | | 8 | ISO-8859-8 Hebrew | | + | |
- | | 9 | Ukrainian font koi8-u | | + | |
- | | 10 | ISO-8859-15 West European, (thin) | | + | |
- | | 11 | ISO-8859-4 Baltic (VGA 9bit mapped) | | + | |
- | | 12 | Russian koi8-r (b) | | + | |
- | | 13 | ISO-8859-4 Baltic wide | | + | |
- | | 14 | ISO-8859-5 Cyrillic | | + | |
- | | 15 | ARMSCII-8 Character set | | + | |
- | | 16 | ISO-8859-15 West European | | + | |
- | | 17 | Codepage 850 Multilingual Latin I, (thin) | | + | |
- | | 18 | Codepage 850 Multilingual Latin I | | + | |
- | | 19 | Codepage 885 Norwegian, (thin) | | + | |
- | | 20 | Codepage 1251 Cyrillic | | + | |
- | | 21 | ISO-8859-7 Greek | | + | |
- | | 22 | Russian koi8-r (c) | | + | |
- | | 23 | ISO-8859-4 Baltic | | + | |
- | | 24 | ISO-8859-1 West European | | + | |
- | | 25 | Codepage 866 Russian | | + | |
- | | 26 | Codepage 437 English, (thin) | | + | |
- | | 27 | Codepage 866 (b) Russian | | + | |
- | | 28 | Codepage 885 Norwegian | | + | |
- | | 29 | Ukrainian font cp866u | | + | |
- | | 30 | ISO-8859-1 West European, (thin) | | + | |
- | | 31 | Codepage 1131 Belarusian, (swiss) | | + | |
- | | 32 | Commodore 64 (UPPER) | | + | |
- | | 33 | Commodore 64 (Lower) | | + | |
- | | 34 | Commodore 128 (UPPER) | | + | |
- | | 35 | Commodore 128 (Lower) | | + | |
- | | 36 | Atari | | + | |
- | | 37 | P0T NOoDLE (Amiga) | | + | |
- | | 38 | mO' | + | |
- | | 39 | MicroKnight Plus (Amiga) | | + | |
- | | 40 | Topaz Plus (Amiga) | | + | |
- | | 41 | MicroKnight (Amiga) | | + | |
- | | 42 | Topaz (Amiga) | | + | |
- | + | ||
- | Not all fonts are supported in all modes. | + | |
- | + | ||
- | ==== Cursor Next Line (CNL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor to the first column of the line Pn down from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Cursor Preceding Line (CPL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor to the first column of the row Pn up from the current position. | + | |
- | + | ||
- | ==== Cursor Character Absolute (CHA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Movies the cursor to column Pn of the current row. | + | |
- | + | ||
- | ==== Cursor Position (CUP) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor to the Pn2th column of the Pn1th line. | + | |
- | + | ||
- | ==== Cursor Forward Tabulation (CHT) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Move the cursor to the Pn-th next tab stop. Basically the same as sending TAB Pn times. | + | |
- | + | ||
- | ==== Erase in Page (ED) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Erases from the current screen according to the value of Ps | + | |
- | | 0 | Erase from the current position to the end of the screen. | | + | |
- | | 1 | Erase from the current position to the start of the screen. | | + | |
- | | 2 | Erase entire screen. | + | |
- | Erased characters are set to the current attribute. | + | |
- | + | ||
- | ==== Erase in Line (EL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Erases from the current line according to the value pf Ps | + | |
- | | 0 | Erase from the current position to the end of the line. | | + | |
- | | 1 | Erase from the current position to the start of the line. | | + | |
- | | 2 | Erase entire line.| | + | |
- | Erased characters are set to the current attribute. | + | |
- | + | ||
- | ==== Insert Line(s) (IL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Inserts Pn lines at the current line position. | + | |
- | + | ||
- | ==== Delete Line(s) / "ANSI Music" (DL) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Deletes the current line and the Pn - 1 lines after it scrolling the first non-deleted line up to the current line and filling the newly empty lines at the end of the screen with the current attribute. If the cursor is not currently inside the scrolling margins, has no effect. If " | + | |
- | + | ||
- | ==== CTerm Set ANSI Music (CTSAM) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets the current state of ANSI music parsing. | + | |
- | | 0 | Only '' | + | |
- | | 1 | Both '' | + | |
- | | 2 | '' | + | |
- | + | ||
- | ==== BananaCom ANSI Music (BCAM) ==== | + | |
- | **Sequence: | + | |
- | If " | + | |
- | + | ||
- | ==== Delete Character (DCH) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Deletes the character at the current position by shifting all characters from the current column + p1 left to the current column. Opened blanks at the end of the line are filled with the current attribute. | + | |
- | + | ||
- | ==== Scroll Up (SU) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Scrolls the screen up Pn lines. | + | |
- | + | ||
- | ==== XTerm Set or Request Graphics Attribute (XTSRGA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | If Ps1 is 2, and Ps2 is 1, replies with the graphics screen information in the following format: '' | + | |
- | + | ||
- | ==== Scroll Down (SD) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Scrolls all text on the screen down Pn lines. | + | |
- | + | ||
- | ==== Erase Character (ECH) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Erase p1 characters starting at the current character. | + | |
- | + | ||
- | ==== Cursor Line Tabulation (CVT) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Move the cursor to the Pn-th next tab stop. Basically the same as sending TAB Pn times. | + | |
- | + | ||
- | ==== Cursor Backward Tabulation (CBT) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Move the cursor to the p1th preceding tab stop. Will not go past the start of the line. | + | |
- | + | ||
- | ==== Character Position Absolute (HPA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Move the cursor to the specified position on the current row. Will not go past the end of the line. | + | |
- | + | ||
- | ==== Cursor Position Forward (HPR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position forward Pn columns from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Repeat (REP) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Repeats the previous graphic character Pn times. | + | |
- | + | ||
- | ==== Device Attributes (DA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | If Ps is 0, CTerm will reply with the sequence: '' | + | |
- | + | ||
- | ==== CTerm Device Attributes (CTDA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | If Pn is 0, CTerm will reply with the sequence: '' | + | |
- | + | ||
- | Possible values for Ps: | + | |
- | | 1 | Loadable fonts are availabe via Device Control Strings | | + | |
- | | 2 | Bright Background (ie: DECSET 32) is supported | | + | |
- | | 3 | Palette entries may be modified via an Operating System Command string | | + | |
- | | 4 | Pixel operations are supported (currently, sixel and PPM graphics) | | + | |
- | | 5 | The current font may be selected via '' | + | |
- | | 6 | Extended palette is available | | + | |
- | | 7 | Mouse is available | | + | |
- | + | ||
- | ==== Line Position Absolute (VPA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves to row specified by Pn. | + | |
- | + | ||
- | ==== Tab Stop Remove (TSR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Removes a tab stop at postion Pn. | + | |
- | + | ||
- | ==== Line Position Forward (VPR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves forward Pn rows. | + | |
- | + | ||
- | ==== Character and Line Position (HVP) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor to the Pn2th column of the Pn1th line. | + | |
- | + | ||
- | ==== Tabulation Clear (TBC) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Deletes tab stops according to the values of Ps: | + | |
- | | 0 | Deletes tab stop at current position. | | + | |
- | | 3 | Deletes all tab stops. | | + | |
- | | 5 | Deletes all tab stops. | | + | |
- | + | ||
- | ==== Enable DoorWay Mode (BCST) / CTerm Set (CTSET) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets the mode specified by Ps | + | |
- | | 4 | Enable Last Column Flag mode (CTELCF) | | + | |
- | | 5 | Enabled Forced Last Column Flag mode (CTFLCF) | | + | |
- | | 255 | Enable DoorWay Mode (BDRWY) | | + | |
- | + | ||
- | ==== DEC Private Mode Set (DECSET) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets one or more mode. The following modes are supported: | + | |
- | ^ Value ^ Mnemonic ^ Default ^ Description ^ | + | |
- | | 6 | DECOM | reset | Enable origin mode. In this mode, position parameters are relative to the top left of the scrolling region, not the screen. | | + | |
- | | 7 | DECAWM | + | |
- | | 9 | | reset | X10 compatible mouse reporting. Mouse button presses will send a '' | + | |
- | | 25 | DECTCEM | + | |
- | | 31 | + | |
- | | 32 | + | |
- | | 33 | + | |
- | | 34 | + | |
- | | 35 | + | |
- | | 69 | + | |
- | | 80 | + | |
- | | 1000 | + | |
- | | 1002 | + | |
- | | 1003 | + | |
- | | 1006 | + | |
- | | 2004 | + | |
- | + | ||
- | ==== Character Position Backward (HPB) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position left Pn columns from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Line Position Backward (VPB) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Moves the cursor position up Pn lines from the current position. Attempting to move past the screen boundaries stops the cursor at the screen boundary. | + | |
- | + | ||
- | ==== Disable DoorWay Mode (BCRST) / CTerm Set (CTRSET) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Resets the mode specified by Ps | + | |
- | | 4 | Disable Last Column Flag mode (CTDLCF) | | + | |
- | | 255 | Disable DoorWay Mode (BDDRWY) | | + | |
- | + | ||
- | ==== DEC Private Mode Reset (DECRST) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Resets one or more mode. The following modes are supported: | + | |
- | ^ Value ^ Mnemonic ^ Default ^ Description ^ | + | |
- | | 6 | DECOM | reset | Origin Mode. With this mode reset, position parameters are relative to the top left of the screen, not the scrolling region. | | + | |
- | | 7 | DECAWM | + | |
- | | 9 | | reset | Disable X10 compatible mouse reporting. | | + | |
- | | 25 | + | |
- | | 31 | + | |
- | | 32 | + | |
- | | 33 | + | |
- | | 34 | + | |
- | | 35 | + | |
- | | 69 | + | |
- | | 80 | + | |
- | | 1000 | + | |
- | | 1001 | + | |
- | | 1002 | + | |
- | | 1003 | + | |
- | | 1004 | + | |
- | | 1005 | + | |
- | | 1006 | + | |
- | | 1007 | + | |
- | | 1015 | + | |
- | | 2004 | + | |
- | + | ||
- | ==== Select Graphic Rendition (SGR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Sets or clears one or more text attributes. | + | |
- | ^ | + | |
- | ^ Ps ^ Description | + | |
- | | 0 | Default attribute, white on black | | + | |
- | | 1 | Bright Intensity | + | |
- | | 2 | Dim intensity | + | |
- | | 5 | Blink (By definition, slow blink) | + | |
- | | 6 | Blink (By definition, fast blink) | + | |
- | | 7 | Negative Image - Reverses FG and BG | | + | |
- | | 8 | Concealed characters, sets the foreground colour to the background colour. | | + | |
- | | 22 | Normal intensity | + | |
- | | 25 | Steady (Not blinking) | + | |
- | | 27 | Positive Image - Restores FG and BG | | + | |
- | | 30 | Black foreground | + | |
- | | 31 | Red foreground | + | |
- | | 32 | Green foreground | + | |
- | | 33 | Yellow foreground | + | |
- | | 34 | Blue foreground | + | |
- | | 35 | Magenta foreground | + | |
- | | 36 | Cyan foreground | + | |
- | | 37 | White foreground | + | |
- | | 38 | Extended Foreground (see notes) | + | |
- | | 39 | Default foreground (same as white) | + | |
- | | 40 | Black background | + | |
- | | 41 | Red background | + | |
- | | 42 | Green background | + | |
- | | 43 | Yellow background | + | |
- | | 44 | Blue background | + | |
- | | 45 | Magenta background | + | |
- | | 46 | Cyan background | + | |
- | | 47 | White background | + | |
- | | 48 | Extended Background (see notes) | + | |
- | | 49 | Default background (same as black) | + | |
- | | 91 | Bright Red foreground | + | |
- | | 92 | Bright Green foreground | + | |
- | | 93 | Bright Yellow foreground | + | |
- | | 94 | Bright Blue foreground | + | |
- | | 95 | Bright Magenta foreground | + | |
- | | 96 | Bright Cyan foreground | + | |
- | | 97 | Bright White foreground | + | |
- | | 100 | Bright Black background | + | |
- | | 101 | Bright Red background | + | |
- | | 102 | Bright Green background | + | |
- | | 103 | Bright Yellow background | + | |
- | | 104 | Bright Blue background | + | |
- | | 105 | Bright Magenta background | + | |
- | | 106 | Bright Cyan background | + | |
- | | 107 | Bright White background | + | |
- | + | ||
- | All others are ignored. | + | |
- | + | ||
- | Blink indicates the blink bit.\\ | + | |
- | Bold indicates the bold bit.\\ | + | |
- | FG indicates the foreground colour.\\ | + | |
- | BG indicates the background colour.\\ | + | |
- | TF indicates that the Tru Colour foreground is changed.\\ | + | |
- | TB indicates that the Tru Colour background is changed.\\ | + | |
- | + | ||
- | NOTE: For 90-97, there is no effect unless bright foreground colours are enabled. | + | |
- | + | ||
- | NOTE: For 100-107, there is no effect unless bright background colours are enabled. | + | |
- | + | ||
- | NOTE: For 38 and 48, two additional formats are supported, a palette selection and a direct colour selection. | + | |
- | + | ||
- | For palette selection, an additional two parameters are required after that value. | + | |
- | + | ||
- | The default palette is the [[https:// | + | |
- | + | ||
- | For direct colour selection, an additional four parameters are required after that value. | + | |
- | + | ||
- | ==== Device Status Report (DSR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | A request for a status report. | + | |
- | | 5 | Request a DSR | CTerm will always reply with CSI 0 n indicating " | + | |
- | | 6 | Request active cursor position | CTerm will reply with CSI y ; x R where y is the current line and x is the current row. | | + | |
- | | 255 | NON-STANDARD EXTENSION (BCDSR) | Replies as though a CSI 6 n was received with the cursor in the bottom right corner. | + | |
- | + | ||
- | ==== CTerm Sate/Mode Request/ | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | When Ps is 1, CTerm will respond with a Font State Report of the form '' | + | |
- | | 0 | successful font selection | | + | |
- | | 1 | failed font selection | | + | |
- | | 99 | no font selection request has been received | | + | |
- | pS0 - pS3 contain the font slots numbers of previously successful "Font Selection" | + | |
- | | pS0 | normal attribute font slot | | + | |
- | | PS1 | high intensity foreground attribute font slot | | + | |
- | | PS2 | blink attribute font slot | | + | |
- | | PS3 | high intensity blink attribute font slot | | + | |
- | + | ||
- | When Ps is 2, CTerm will respond with a Mode Report of the form '' | + | |
- | + | ||
- | When Ps is 3, CTerm will respond with a Mode Report of the form '' | + | |
- | + | ||
- | When Ps is 4, CTerm will respond with a Mode Report of the form '' | + | |
- | + | ||
- | When Ps is 5, CTerm will respond with a Mode Report of the form '' | + | |
- | + | ||
- | ==== DEC Device STatus Report (DECDSR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | + | ||
- | When Ps is 62 (DECMSR) and there is no Pn, CTerm will respond with a Mode Report of the form '' | + | |
- | + | ||
- | When Ps is 63 (DECCKSR) Pn defaults to 1, and CTerm will respond with a checksum of the defined macros in the form '' | + | |
- | + | ||
- | ==== DEC Set Top and Bottom Margins (DECSTBM) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Selects top and bottom margins, defining the scrolling region. Pn1 is the line number of the first line in the scrolling region. Pn2 is the line number of the bottom line. | + | |
- | + | ||
- | ==== DEC Select Communication Speed (DECSCS) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Set the output emulation speed (Select Communication Speed). If Ps1 or Ps2 are omitted, causes output speed emulation to stop. Ps1 may be empty. Sequence is ignored if Ps1 is not empty, 0, or 1. The value of Ps2 sets the output speed emulation as follows: | + | |
- | + | ||
- | ^ Value ^ Speed ^ | + | |
- | | empty, 0 | Unlimited | | + | |
- | | 1 | 300 | | + | |
- | | 2 | 600 | | + | |
- | | 3 | 1200 | | + | |
- | | 4 | 2400 | | + | |
- | | 5 | 4800 | | + | |
- | | 6 | 9600 | | + | |
- | | 7 | 19200 | | + | |
- | | 8 | 38400 | | + | |
- | | 9 | 57600 | | + | |
- | | 10 | 76800 | | + | |
- | | 11 | 115200 | + | |
- | + | ||
- | ==== CTerm Save Mode Setting (CTSMS) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Saves the current mode states as specified by '' | + | |
- | + | ||
- | ==== DEC Set Left and Right Margin (DECSLRM) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | (Only when DEC Left Right Margin Mode - 69 - is enabled)\\ | + | |
- | If either Pn1 or Pn2 is zero, the current setting is retained. Selects left and right margins, defining the scrolling region. Pn1 is the column number of the first column in the scrolling region. Pn2 is the column number of the right column. | + | |
- | + | ||
- | ==== SCO Save Cursor ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | (Only when DEC Left Right Margin Mode - 69 - is disabled)\\ | + | |
- | Saves the current cursor position for later restoring with '' | + | |
- | + | ||
- | ==== CTerm 24=Bit Colour (CT24BC) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Select a 24-bit colour. If Ps is 0, sets the background colour. If Ps is 1, sets the foreground colour. Pn1, Pn2, Pn3 contains the RGB value to set. CTerm handles this with an internal temporary palette, so scrollback may not have the correct colours. | + | |
- | + | ||
- | ==== CTerm Restore Mode Setting (CTRMS) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Restores the mode states as saved via CSI ? s. If Ps is omitted, restores all such states. | + | |
- | + | ||
- | ==== SCO Restore Cursor (SCORC) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Move the cursor to the last position saved by CSI s. If no position has been saved, the cursor is not moved. | + | |
- | + | ||
- | ==== DEC Tab Stop Report (DECTABSR) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Requests a list of tab stops. The list is in the form: '' | + | |
- | + | ||
- | ==== DEC Request Checksum of Rectangular Area (DECRQCRA) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Returns a checksum for the specified rectangular area. Pn1 is an ID that is returned in the response. Ps MUST be 1. Pn2 specifies the top row of the rectangle. Pn3 specifies the left column of the rectangle. Pn4 specifies the bottom row of the rectangle. Pn5 specifies the right column of the rectangle. The return value is in the format of '' | + | |
- | + | ||
- | ==== DEC Invoke Macro (DECINVM) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | Invokes a macro. Pn specifies the macro number. | + | |
- | + | ||
- | ==== CTerm Obsolete Send Font (CTOSF) ==== | + | |
- | **Sequence: | + | |
- | **Defaults: | + | |
- | This is a poorly defined command that violates the basic design laid out in ECMA-48. | + | |
- | + | ||
- | Indicates that a font block is following. Ps1 indicates the font slot to place the loaded font into. This must be higher than the last default defined font (See CSI sp D for list of predefined fonts) | + | |
- | | 0 | 8x16 font, 4096 bytes. | | + | |
- | | 1 | 8x14 font, 3584 bytes. | | + | |
- | | 2 | 8x8 font, 2048 bytes. | | + | |
- | + | ||
- | The DCS font string should be used instead as of CTerm 1.213 | + | |
- | + | ||
- | ===== " | + | |
- | This is the place where the BBS world completely fell on it's face in ANSI usage. | + | |
- | '' | + | |
- | + | ||
- | They used a subset of IBM BASICs PLAY statement functionality for ANSI music strings which often start with " | + | |
- | + | ||
- | Later on, BananaCom realized the conflict between delete line and music, so they added *another* broken code CSI N (Properly, erase in field... not implemented in many BBS clients) which was to provide an " | + | |
- | + | ||
- | CTerm has further introduced a standard compliant ANSI music introducer CSI | | + | |
- | + | ||
- | By default, CTerm allows both CSI N and CSI | to introduce a music string. Allowed introducers are set by CSI = p1 M as defined above. | + | |
- | + | ||
- | The details of ANSI music then are as follows:\\ | + | |
- | The following characters are allowed in music strings:\\ | + | |
- | " | + | |
- | If any character not in this list is present, the music string is ignored as is the introducing code. | + | |
- | + | ||
- | If the introducing code is CSI M the first char is examined, and if it is a one of " | + | |
- | + | ||
- | The music string is then parsed with the following sequences supported: | + | |
- | | Mx | sets misc. music parameters where x is one of the following: || | + | |
- | | | F | Plays music in the foreground, waiting for music to complete playing before more characters are processed. | | + | |
- | | | B | Play music in the background, allowing normal processing to continue. | | + | |
- | | | N | " | + | |
- | | | L | Play notes legato | | + | |
- | | | S | Play notes staccato | | + | |
- | | T### | Sets the tempo of the music where ### is one or more decimal digits. If the decimal number is greater than 255, it is forced to 255. If it is less than 32, it is forced to 32. The number signifies quarter notes per minute. The default tempo is 120. || | + | |
- | | O### | Sets the octave of the music where ### is one or more decimal digits. If the decimal number is greater than 6, it is forced to 6.The default octave is 4. || | + | |
- | | N### | Plays a single note by number. | + | |
- | | A,\\ B,\\ C,\\ D,\\ E,\\ F,\\ G,\\ P | Plays the named note or pause from the current octave. | + | |
- | | | + | Sharp. | + | |
- | | | # | Sharp. | + | |
- | | | - | Flat. The next lowest semitone is played. Each flat character will move down one semitone, so " | + | |
- | | | . | Duration is 1.5 times what it would otherwise be. Dots are not cumulative, so " | + | |
- | | | ### | Notelength as a reciprocal of the fraction of a whole note to play the note for. For example, 4 would indicate a ¼ note. The default note length is 4. | | + | |
- | | L### | Set the notelength parameter for all following notes which do not have one specified (ie: override the quarter-note default) | + | |
- | | < | Move the next lowest octave. Octave cannot go above six or below zero. || | + | |
- | | > | Move to the next highest octave. Octave cannot go above six or below zero. || | + | |
- | + | ||
- | The lowest playable character is C in octave zero. The frequencies for the six C notes for the seven octaves in rising order are:\\ | + | |
- | 65.406, 130.810, 261.620, 523.250, 1046.500, 2093.000, 4186.000 | + | |
- | + | ||
- | Purists will note that the lower three octaves are not exactly one half of the next higher octave in frequency. | + | |
- | + | ||
- | !!!PLEASE NOTE!!! If you are playing some ANSI Music then ask the user if they heard it, ALWAYS follow it with an 0x0f as 0x0e is the shift lock character which *will* cause people with anything but an ANSI-BBS terminal (ie: *nix users using the bundled telnet app) to have their screen messed up. 0x0f " | + | |
- | + | ||
- | ===== Key Sequences ===== | + | |
- | While CTerm does not handle keyboard I/O, and therefore does not send any key sequences, it's only used by one piece of software (SyncTERM), which does send a set of sequences when keys are pressed. | + | |
- | + | ||
- | | Left Arrow | " | + | |
- | | Right Arrow | " | + | |
- | | Up Arrow | " | + | |
- | | Down Arrow | " | + | |
- | | Home | " | + | |
- | | End | " | + | |
- | | Delete | + | |
- | | Page Down | " | + | |
- | | Page Up | " | + | |
- | | F1 | " | + | |
- | | F2 | " | + | |
- | | F3 | " | + | |
- | | F4 | " | + | |
- | | F5 | " | + | |
- | | F6 | " | + | |
- | | F7 | " | + | |
- | | F8 | " | + | |
- | | F9 | " | + | |
- | | F10 | " | + | |
- | | F11 | " | + | |
- | | F12 | " | + | |
- | | Shift + F1 | " | + | |
- | | Shift + F2 | " | + | |
- | | Shift + F3 | " | + | |
- | | Shift + F4 | " | + | |
- | | Shift + F5 | " | + | |
- | | Shift + F6 | " | + | |
- | | Shift + F7 | " | + | |
- | | Shift + F8 | " | + | |
- | | Shift + F9 | " | + | |
- | | Shift + F10 | " | + | |
- | | Shift + F11 | " | + | |
- | | Shift + F12 | " | + | |
- | | Alt + F1 | " | + | |
- | | Alt + F2 | " | + | |
- | | Alt + F3 | " | + | |
- | | Alt + F4 | " | + | |
- | | Alt + F5 | " | + | |
- | | Alt + F6 | " | + | |
- | | Alt + F7 | " | + | |
- | | Alt + F8 | " | + | |
- | | Alt + F9 | " | + | |
- | | Alt + F10 | " | + | |
- | | Alt + F11 | " | + | |
- | | Alt + F12 | " | + | |
- | | Control + F1 | " | + | |
- | | Control + F2 | " | + | |
- | | Control + F3 | " | + | |
- | | Control + F4 | " | + | |
- | | Control + F5 | " | + | |
- | | Control + F6 | " | + | |
- | | Control + F7 | " | + | |
- | | Control + F8 | " | + | |
- | | Control + F9 | " | + | |
- | | Control + F10 | " | + | |
- | | Control + F11 | " | + | |
- | | Control + F12 | " | + | |
- | | Insert | + | |
- | | Back Tab | " | + | |
===== See Also ===== | ===== See Also ===== |