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 11:36] – Save edits, format being worked out 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 implements the following APS commands: | + | |
- | + | ||
- | === 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
- | + | ||
- | ==== 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. ECMA-48 | + | |
===== See Also ===== | ===== See Also ===== | ||
* [[: | * [[: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
{{tag>}} | {{tag>}} | ||