diff --git a/index.js b/index.js index 4dffb4c..6a54e17 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ // match[1] = visible text // match[2] = relevant escape code // match[3] = skippable escape code -const ANSI_SEQUENCE = /^(.*?)(?:(\x1b\[[^m]+m|\x1b\]8;;.*?(?:\x1b\\|\u0007))|(\x1b\[\?[0-9]+[a-zA-Z]))/; +const ANSI_SEQUENCE = /^([\s\S]*?)(?:(\x1b\[[^m]+m|\x1b\]8;;[\s\S]*?(?:\x1b\\|\u0007))|(\x1b\[\?[0-9]+[a-zA-Z]))/; const segmenter = new Intl.Segmenter(`en`, {granularity: `grapheme`});