* @license MIT
*/
-// TODO: Give CHARSETS a proper type
/**
* The character sets supported by the terminal. These enable several languages
* to be represented within the terminal with only 8-bit encoding. See ISO 2022
- * for a discussion on character sets.
+ * for a discussion on character sets. Only VT100 character sets are supported.
*/
-export const CHARSETS: any = {};
+export const CHARSETS: {[key: string]: {[key: string]: string}} = {};
-// DEC Special Character and Line Drawing Set.
-// http://vt100.net/docs/vt102-ug/table5-13.html
-// A lot of curses apps use this if they see TERM=xterm.
-// testing: echo -e '\e(0a\e(B'
-// The xterm output sometimes seems to conflict with the
-// reference above. xterm seems in line with the reference
-// when running vttest however.
-// The table below now uses xterm's output from vttest.
-CHARSETS.SCLD = { // (0
+/**
+ * The default character set, US.
+ */
+export const DEFAULT_CHARSET = CHARSETS['B'];
+
+/**
+ * DEC Special Character and Line Drawing Set.
+ * Reference: http://vt100.net/docs/vt102-ug/table5-13.html
+ * A lot of curses apps use this if they see TERM=xterm.
+ * testing: echo -e '\e(0a\e(B'
+ * The xterm output sometimes seems to conflict with the
+ * reference above. xterm seems in line with the reference
+ * when running vttest however.
+ * The table below now uses xterm's output from vttest.
+ */
+CHARSETS['0'] = {
'`': '\u25c6', // '◆'
'a': '\u2592', // '▒'
'b': '\u0009', // '\t'
* ESC (A
* Reference: http://vt100.net/docs/vt220-rm/table2-5.html
*/
-CHARSETS.UK = {
+CHARSETS['A'] = {
'#': '£'
};
* United States character set
* ESC (B
*/
-CHARSETS.US = null;
+CHARSETS['B'] = null;
/**
* Dutch character set
* ESC (4
* Reference: http://vt100.net/docs/vt220-rm/table2-6.html
*/
-CHARSETS.Dutch = { // (4
+CHARSETS['4'] = {
'#': '£',
'@': '¾',
'[': 'ij',
* ESC (C or ESC (5
* Reference: http://vt100.net/docs/vt220-rm/table2-7.html
*/
-CHARSETS.Finnish = {
+CHARSETS['C'] =
+CHARSETS['5'] = {
'[': 'Ä',
'\\': 'Ö',
']': 'Å',
* ESC (R
* Reference: http://vt100.net/docs/vt220-rm/table2-8.html
*/
-CHARSETS.French = {
+CHARSETS['R'] = {
'#': '£',
'@': 'à',
'[': '°',
* ESC (Q
* Reference: http://vt100.net/docs/vt220-rm/table2-9.html
*/
-CHARSETS.FrenchCanadian = {
+CHARSETS['Q'] = {
'@': 'à',
'[': 'â',
'\\': 'ç',
* ESC (K
* Reference: http://vt100.net/docs/vt220-rm/table2-10.html
*/
-CHARSETS.German = {
+CHARSETS['K'] = {
'@': '§',
'[': 'Ä',
'\\': 'Ö',
* ESC (Y
* Reference: http://vt100.net/docs/vt220-rm/table2-11.html
*/
-CHARSETS.Italian = {
+CHARSETS['Y'] = {
'#': '£',
'@': '§',
'[': '°',
* ESC (E or ESC (6
* Reference: http://vt100.net/docs/vt220-rm/table2-12.html
*/
-CHARSETS.NorwegianDanish = {
+CHARSETS['E'] =
+CHARSETS['6'] = {
'@': 'Ä',
'[': 'Æ',
'\\': 'Ø',
* ESC (Z
* Reference: http://vt100.net/docs/vt220-rm/table2-13.html
*/
-CHARSETS.Spanish = {
+CHARSETS['Z'] = {
'#': '£',
'@': '§',
'[': '¡',
* ESC (H or ESC (7
* Reference: http://vt100.net/docs/vt220-rm/table2-14.html
*/
-CHARSETS.Swedish = {
+CHARSETS['H'] =
+CHARSETS['7'] = {
'@': 'É',
'[': 'Ä',
'\\': 'Ö',
* ESC (=
* Reference: http://vt100.net/docs/vt220-rm/table2-15.html
*/
-CHARSETS.Swiss = {
+CHARSETS['='] = {
'#': 'ù',
'@': 'à',
'[': 'é',
'}': 'ü',
'~': 'û'
};
-
-CHARSETS.ISOLatin = null; // /A