Skip to content

Commit

Permalink
Support [P escape (delete character) (#10)
Browse files Browse the repository at this point in the history
* [feat] support [P code (delete character)

* remove [Q detection. fix typo as well.

* fix '[0P' test desription
  • Loading branch information
Dima Paloskin authored and Qix- committed Jan 14, 2017
1 parent e8beaf5 commit fcb3c28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fixtures/ansi-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ exports.ansiCompatible = {
'[J': ['Erase from cursor to end of screen'],
'[0J': ['Same'],
'[2J': ['Erase entire screen'],
'[P' : ['Delete character'],
'[0P': ['Delete character (0P)'],
'[2P': ['Delete 2 characters'],

'(A': ['United Kingdom (UK) (Character Set G0)'],
')A': ['United Kingdom (UK) (Character Set G1)'],
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
module.exports = function () {
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
};

0 comments on commit fcb3c28

Please sign in to comment.