Skip to content

Commit 8e61a1f

Browse files
authored
util: update ansi regex
1 parent c3a7b29 commit 8e61a1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/util/inspect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ const meta = [
246246
// Matches all ansi escape code sequences in a string
247247
const ansiPattern = '[\\u001B\\u009B][[\\]()#;?]*' +
248248
'(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*' +
249-
'|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)' +
250-
'|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))';
249+
'|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))' +
250+
'|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))';
251251
const ansi = new RegExp(ansiPattern, 'g');
252252

253253
let getStringWidth;

0 commit comments

Comments
 (0)