Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser refactor and optimization #462

Merged
merged 29 commits into from
Jan 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
04b1ebf
Create InputHandler which performs C0 actions
Tyriar Jan 9, 2017
659fb90
Handle C0 codes via handler map in Parser
Tyriar Jan 9, 2017
665a11a
Add C0.BS handler back
Tyriar Jan 9, 2017
a31921a
Move parsing logic into Parser.ts
Tyriar Jan 9, 2017
4a27b9a
Move wcwidth into Parser.ts
Tyriar Jan 9, 2017
940bd26
Fix wcwidth TS errors
Tyriar Jan 9, 2017
991b284
Fix references to Terminaal and fix TS lint warnings
Tyriar Jan 9, 2017
1848fff
Pull charsets out of xterm.js
Tyriar Jan 9, 2017
f4267c4
Merge remote-tracking branch 'upstream/master' into 459_parser__on_460
Tyriar Jan 9, 2017
6deaaa8
Move all parser state handling into the parser
Tyriar Jan 9, 2017
672dc1a
Start pulling CSI handlers out
Tyriar Jan 9, 2017
635a4d7
Handle CSI postfix
Tyriar Jan 9, 2017
9942477
Start converting CSI codes
Tyriar Jan 9, 2017
7572dd5
Remove IInputHandler from CSI_PARAM lambdas
Tyriar Jan 9, 2017
c7fa2d5
Handle remaining CSI_PARAM cases and introduce the state
Tyriar Jan 10, 2017
db81c28
Support more CSI codes, remove unused CSI helper functions
Tyriar Jan 10, 2017
411b80c
Add CSI @, E, F, G
Tyriar Jan 10, 2017
342e862
Merge remote-tracking branch 'upstream/master' into 459_parser__on_460
Tyriar Jan 11, 2017
f9a286a
Convert more CSI codes
Tyriar Jan 13, 2017
c43c3b4
Add more CSI codes
Tyriar Jan 13, 2017
9b66208
Add more CSI codes
Tyriar Jan 13, 2017
f4846aa
Finish CSI codes
Tyriar Jan 13, 2017
fa3484c
Pull character add char code to input handler
Tyriar Jan 13, 2017
ecd7e69
Start adding ESC state handler
Tyriar Jan 13, 2017
4448ebe
Use charsets to map
Tyriar Jan 15, 2017
5e1ccb3
Merge remote-tracking branch 'upstream/master' into 459_parser__on_460
Tyriar Jan 16, 2017
1cdd2e0
Remove parser states from xterm.js
Tyriar Jan 16, 2017
e2b2f98
Merge remote-tracking branch 'upstream/master' into 459_parser__on_460
Tyriar Jan 16, 2017
ef60e50
Add documentation
Tyriar Jan 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions src/Charsets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @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.
*/
export const CHARSETS: any = {};

// 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
'`': '\u25c6', // '◆'
'a': '\u2592', // '▒'
'b': '\u0009', // '\t'
'c': '\u000c', // '\f'
'd': '\u000d', // '\r'
'e': '\u000a', // '\n'
'f': '\u00b0', // '°'
'g': '\u00b1', // '±'
'h': '\u2424', // '\u2424' (NL)
'i': '\u000b', // '\v'
'j': '\u2518', // '┘'
'k': '\u2510', // '┐'
'l': '\u250c', // '┌'
'm': '\u2514', // '└'
'n': '\u253c', // '┼'
'o': '\u23ba', // '⎺'
'p': '\u23bb', // '⎻'
'q': '\u2500', // '─'
'r': '\u23bc', // '⎼'
's': '\u23bd', // '⎽'
't': '\u251c', // '├'
'u': '\u2524', // '┤'
'v': '\u2534', // '┴'
'w': '\u252c', // '┬'
'x': '\u2502', // '│'
'y': '\u2264', // '≤'
'z': '\u2265', // '≥'
'{': '\u03c0', // 'π'
'|': '\u2260', // '≠'
'}': '\u00a3', // '£'
'~': '\u00b7' // '·'
};

CHARSETS.UK = null; // (A
CHARSETS.US = null; // (B (USASCII)
CHARSETS.Dutch = null; // (4
CHARSETS.Finnish = null; // (C or (5
CHARSETS.French = null; // (R
CHARSETS.FrenchCanadian = null; // (Q
CHARSETS.German = null; // (K
CHARSETS.Italian = null; // (Y
CHARSETS.NorwegianDanish = null; // (E or (6
CHARSETS.Spanish = null; // (Z
CHARSETS.Swedish = null; // (H or (7
CHARSETS.Swiss = null; // (=
CHARSETS.ISOLatin = null; // /A
Loading