Skip to content

Commit 099c7d8

Browse files
authoredMay 21, 2018
Merge pull request #1399 from jerch/new_parser
new parser
2 parents 8d722d2 + 6bc6ea5 commit 099c7d8

10 files changed

+2564
-108
lines changed
 

‎src/EscapeSequenceParser.test.ts

+1,243
Large diffs are not rendered by default.

‎src/EscapeSequenceParser.ts

+544
Large diffs are not rendered by default.

‎src/EscapeSequences.ts

+71
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,74 @@ export namespace C0 {
7777
/** Delete (Caret = ^?) */
7878
export const DEL = '\x7f';
7979
}
80+
81+
/**
82+
* C1 control codes
83+
* See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
84+
*/
85+
export namespace C1 {
86+
/** padding character */
87+
export const PAD = '\x80';
88+
/** High Octet Preset */
89+
export const HOP = '\x81';
90+
/** Break Permitted Here */
91+
export const BPH = '\x82';
92+
/** No Break Here */
93+
export const NBH = '\x83';
94+
/** Index */
95+
export const IND = '\x84';
96+
/** Next Line */
97+
export const NEL = '\x85';
98+
/** Start of Selected Area */
99+
export const SSA = '\x86';
100+
/** End of Selected Area */
101+
export const ESA = '\x87';
102+
/** Horizontal Tabulation Set */
103+
export const HTS = '\x88';
104+
/** Horizontal Tabulation With Justification */
105+
export const HTJ = '\x89';
106+
/** Vertical Tabulation Set */
107+
export const VTS = '\x8a';
108+
/** Partial Line Down */
109+
export const PLD = '\x8b';
110+
/** Partial Line Up */
111+
export const PLU = '\x8c';
112+
/** Reverse Index */
113+
export const RI = '\x8d';
114+
/** Single-Shift 2 */
115+
export const SS2 = '\x8e';
116+
/** Single-Shift 3 */
117+
export const SS3 = '\x8f';
118+
/** Device Control String */
119+
export const DCS = '\x90';
120+
/** Private Use 1 */
121+
export const PU1 = '\x91';
122+
/** Private Use 2 */
123+
export const PU2 = '\x92';
124+
/** Set Transmit State */
125+
export const STS = '\x93';
126+
/** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */
127+
export const CCH = '\x94';
128+
/** Message Waiting */
129+
export const MW = '\x95';
130+
/** Start of Protected Area */
131+
export const SPA = '\x96';
132+
/** End of Protected Area */
133+
export const EPA = '\x97';
134+
/** Start of String */
135+
export const SOS = '\x98';
136+
/** Single Graphic Character Introducer */
137+
export const SGCI = '\x99';
138+
/** Single Character Introducer */
139+
export const SCI = '\x9a';
140+
/** Control Sequence Introducer */
141+
export const CSI = '\x9b';
142+
/** String Terminator */
143+
export const ST = '\x9c';
144+
/** Operating System Command */
145+
export const OSC = '\x9d';
146+
/** Privacy Message */
147+
export const PM = '\x9e';
148+
/** Application Program Command */
149+
export const APC = '\x9f';
150+
}

‎src/InputHandler.test.ts

+11-10
Original file line numberDiff line numberDiff line change
@@ -29,53 +29,54 @@ describe('InputHandler', () => {
2929
it('should call Terminal.setOption with correct params', () => {
3030
let terminal = new MockInputHandlingTerminal();
3131
let inputHandler = new InputHandler(terminal);
32+
const collect = ' ';
3233

33-
inputHandler.setCursorStyle([0]);
34+
inputHandler.setCursorStyle([0], collect);
3435
assert.equal(terminal.options['cursorStyle'], 'block');
3536
assert.equal(terminal.options['cursorBlink'], true);
3637

3738
terminal.options = {};
38-
inputHandler.setCursorStyle([1]);
39+
inputHandler.setCursorStyle([1], collect);
3940
assert.equal(terminal.options['cursorStyle'], 'block');
4041
assert.equal(terminal.options['cursorBlink'], true);
4142

4243
terminal.options = {};
43-
inputHandler.setCursorStyle([2]);
44+
inputHandler.setCursorStyle([2], collect);
4445
assert.equal(terminal.options['cursorStyle'], 'block');
4546
assert.equal(terminal.options['cursorBlink'], false);
4647

4748
terminal.options = {};
48-
inputHandler.setCursorStyle([3]);
49+
inputHandler.setCursorStyle([3], collect);
4950
assert.equal(terminal.options['cursorStyle'], 'underline');
5051
assert.equal(terminal.options['cursorBlink'], true);
5152

5253
terminal.options = {};
53-
inputHandler.setCursorStyle([4]);
54+
inputHandler.setCursorStyle([4], collect);
5455
assert.equal(terminal.options['cursorStyle'], 'underline');
5556
assert.equal(terminal.options['cursorBlink'], false);
5657

5758
terminal.options = {};
58-
inputHandler.setCursorStyle([5]);
59+
inputHandler.setCursorStyle([5], collect);
5960
assert.equal(terminal.options['cursorStyle'], 'bar');
6061
assert.equal(terminal.options['cursorBlink'], true);
6162

6263
terminal.options = {};
63-
inputHandler.setCursorStyle([6]);
64+
inputHandler.setCursorStyle([6], collect);
6465
assert.equal(terminal.options['cursorStyle'], 'bar');
6566
assert.equal(terminal.options['cursorBlink'], false);
6667
});
6768
});
6869
describe('setMode', () => {
6970
it('should toggle Terminal.bracketedPasteMode', () => {
7071
let terminal = new MockInputHandlingTerminal();
71-
terminal.prefix = '?';
72+
const collect = '?';
7273
terminal.bracketedPasteMode = false;
7374
let inputHandler = new InputHandler(terminal);
7475
// Set bracketed paste mode
75-
inputHandler.setMode([2004]);
76+
inputHandler.setMode([2004], collect);
7677
assert.equal(terminal.bracketedPasteMode, true);
7778
// Reset bracketed paste mode
78-
inputHandler.resetMode([2004]);
79+
inputHandler.resetMode([2004], collect);
7980
assert.equal(terminal.bracketedPasteMode, false);
8081
});
8182
});

0 commit comments

Comments
 (0)
Please sign in to comment.