Skip to content

Commit

Permalink
Add scroll escapes (#20)
Browse files Browse the repository at this point in the history
Fixes #19
  • Loading branch information
Qix- authored and sindresorhus committed Sep 18, 2018
1 parent 14839a4 commit 385eca9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fixtures/ansi-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ exports.vt52Codes = new Map([
['I', ['Reverse line feed']],
['J', ['Erase to end of screen']],
['K', ['Erase to end of line']],
['S', ['Scroll up']],
['T', ['Scroll down']],
['Z', ['Identify']],
['=', ['Enter alternate keypad mode']],
['>', ['Exit alternate keypad mode']],
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = () => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');

return new RegExp(pattern, 'g');
Expand Down

0 comments on commit 385eca9

Please sign in to comment.