We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sindresorhus
Qix-
Learn more about funding links in repositories.
Report abuse
1 parent 3dff5e7 commit 69bebf6Copy full SHA for 69bebf6
fixtures/ansi-codes.js
@@ -212,3 +212,20 @@ exports.otherCode = new Map([
212
['3n', ['Response: terminal is not OK', 'DSR']],
213
['6n', ['Get cursor position', 'DSR']]
214
]);
215
+
216
+// urxvt escapes
217
+exports.urxvt = new Map([
218
+ ['[5~', ['URxvt.keysym.Prior']],
219
+ ['[6~', ['URxvt.keysym.Next']],
220
+ ['[7~', ['URxvt.keysym.Home']],
221
+ ['[8~', ['URxvt.keysym.End']],
222
+ ['[A', ['URxvt.keysym.Up']],
223
+ ['[B', ['URxvt.keysym.Down']],
224
+ ['[C', ['URxvt.keysym.Right']],
225
+ ['[D', ['URxvt.keysym.Left']],
226
+ ['[3;5;5t', ['URxvt.keysym.C-M-q']],
227
+ ['[3;5;606t', ['URxvt.keysym.C-M-y']],
228
+ ['[3;1605;5t', ['URxvt.keysym.C-M-e']],
229
+ ['[3;1605;606t', ['URxvt.keysym.C-M-c']],
230
+ [']710;9x15bold\x07', ['URxvt.keysym.font']]
231
+]);
index.js
@@ -1,2 +1,10 @@
1
'use strict';
2
-module.exports = () => (/[\u001B\u009B][[()#;?]*(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PRZcf-nqry=><]/g);
3
+module.exports = () => {
4
+ const pattern = [
5
+ '[\\u001b\\u009b][[\\]()#;?]*(?:(?:(?:[a-zA-Z0-9]*(?:;[a-zA-Z0-9]*)*)?\\x07)',
6
+ '(?:(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-ntqry=><~]))'
7
+ ].join('|');
8
9
+ return new RegExp(pattern, 'g');
10
+};
0 commit comments