1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | "use strict" ;
|
28 |
|
29 |
|
30 |
|
31 | const tree = require( 'tree-kit' ) ;
|
32 | const xterm = require( './xterm.js' ) ;
|
33 |
|
34 |
|
35 |
|
36 | const esc = tree.extend( null , Object.create( xterm.esc ) , {
|
37 |
|
38 | setClipboardLL: { na: true } ,
|
39 | requestClipboard: { na: true } ,
|
40 |
|
41 |
|
42 | blockCursor: { on: '' , na: true } ,
|
43 | blinkingBlockCursor: { on: '' , na: true } ,
|
44 | underlineCursor: { on: '' , na: true } ,
|
45 | blinkingUnderlineCursor: { on: '' , na: true } ,
|
46 | beamCursor: { on: '' , na: true } ,
|
47 | blinkingBeamCursor: { on: '' , na: true } ,
|
48 |
|
49 |
|
50 | mouseDrag: { on: '\x1b[?1000h' , off: '\x1b[?1000l' , fb: true } ,
|
51 | mouseMotion: { on: '\x1b[?1000h' , off: '\x1b[?1000l' , fb: true } ,
|
52 |
|
53 | requestColor: { on: '%D' , na: true }
|
54 | } ) ;
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | const keymap = tree.extend( null , Object.create( xterm.keymap ) , {
|
65 | F1: '\x1b[11~' ,
|
66 | F2: '\x1b[12~' ,
|
67 | F3: '\x1b[13~' ,
|
68 | F4: '\x1b[14~' ,
|
69 |
|
70 |
|
71 |
|
72 | SHIFT_F3: '\x1b[25~' ,
|
73 | SHIFT_F4: '\x1b[26~' ,
|
74 | SHIFT_F5: '\x1b[28~' ,
|
75 | SHIFT_F6: '\x1b[29~' ,
|
76 | SHIFT_F7: '\x1b[31~' ,
|
77 | SHIFT_F8: '\x1b[32~' ,
|
78 | SHIFT_F9: '\x1b[33~' ,
|
79 | SHIFT_F10: '\x1b[34~' ,
|
80 | SHIFT_F11: '\x1b[23$' ,
|
81 | SHIFT_F12: '\x1b[24$' ,
|
82 |
|
83 | CTRL_F1: '\x1b[11^' ,
|
84 | CTRL_F2: '\x1b[12^' ,
|
85 | CTRL_F3: '\x1b[13^' ,
|
86 | CTRL_F4: '\x1b[14^' ,
|
87 | CTRL_F5: '\x1b[15^' ,
|
88 | CTRL_F6: '\x1b[17^' ,
|
89 | CTRL_F7: '\x1b[18^' ,
|
90 | CTRL_F8: '\x1b[19^' ,
|
91 | CTRL_F9: '\x1b[20^' ,
|
92 | CTRL_F10: '\x1b[21^' ,
|
93 | CTRL_F11: '\x1b[23^' ,
|
94 | CTRL_F12: '\x1b[24^' ,
|
95 |
|
96 |
|
97 |
|
98 | CTRL_SHIFT_F3: '\x1b[25^' ,
|
99 | CTRL_SHIFT_F4: '\x1b[26^' ,
|
100 | CTRL_SHIFT_F5: '\x1b[28^' ,
|
101 | CTRL_SHIFT_F6: '\x1b[29^' ,
|
102 | CTRL_SHIFT_F7: '\x1b[31^' ,
|
103 | CTRL_SHIFT_F8: '\x1b[32^' ,
|
104 | CTRL_SHIFT_F9: '\x1b[33^' ,
|
105 | CTRL_SHIFT_F10: '\x1b[34^' ,
|
106 | CTRL_SHIFT_F11: '\x1b[23@' ,
|
107 | CTRL_SHIFT_F12: '\x1b[24@'
|
108 |
|
109 | } ) ;
|
110 |
|
111 |
|
112 |
|
113 | const handler = Object.create( xterm.handler ) ;
|
114 |
|
115 |
|
116 |
|
117 | module.exports = {
|
118 | esc: esc ,
|
119 | keymap: keymap ,
|
120 | handler: handler ,
|
121 | support: {
|
122 | deltaEscapeSequence: true ,
|
123 | "256colors": false ,
|
124 | "24bitsColors": false ,
|
125 | "trueColor": false
|
126 | } ,
|
127 | colorRegister: require( '../colorScheme/xterm.json' )
|
128 | } ;
|
129 |
|