Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
Detect single SGR with SGR RegEx
Browse files Browse the repository at this point in the history
  • Loading branch information
hSaria committed Sep 13, 2019
1 parent 09c2bfe commit 7845e89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chromaterm/__init__.py
Expand Up @@ -59,7 +59,7 @@
r'1049[hl]|\r|\r\n|\n|\v|\f)')

# Select Graphic Rendition sequence (all types)
SGR_RE = re.compile(r'(?:\033\[[0-9;]*m)+')
SGR_RE = re.compile(r'\033\[[0-9;]*m')

# Maximum chuck size per read
READ_SIZE = 4096 # 4 KiB
Expand Down
2 changes: 1 addition & 1 deletion chromaterm/test___init__.py
Expand Up @@ -569,7 +569,7 @@ def test_highlight_existing_compound():
data = '\033[33m\033[1mHello World'
expected = [
'\033[33m\033[1m', 'Hello ', '\033[38;5;153m', 'World',
'\033[33m\033[1m'
'\033[33m'
]

assert repr(chromaterm.highlight(config, data)) == repr(''.join(expected))
Expand Down

0 comments on commit 7845e89

Please sign in to comment.