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

Commit

Permalink
Relax OSC regex match requirements to allow for extended characters, …
Browse files Browse the repository at this point in the history
…like Emojis (non-compliant with ECMA-048)
  • Loading branch information
hSaria committed Dec 20, 2021
1 parent 598de0d commit edc22a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chromaterm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
SPLIT_RE = re.compile(br'(\r\n?|\n|\v|\f|\x1b[\x40-\x5a\x5c\x5e\x5f]|'
br'\x1b[\x28-\x2b\x2d-\x2f][\x20-\x7e]|'
br'\x1b\x5b[\x30-\x3f]*[\x20-\x2f]*[\x40-\x6c\x6e-\x7e]|'
br'\x1b\x5d[\x08-\x0d\x20-\x7e]*(?:\x07|\x1b\x5c))')
br'\x1b\x5d[^\x07\x1b]*(?:\x07|\x1b\x5c))')


def args_init(args=None):
Expand Down
3 changes: 2 additions & 1 deletion tests/test__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ def test_split_buffer_osc_title():
'''Operating System Command (OSC) can supply arbitrary commands within the
visible character set.'''
for end in [b'\x07', b'\x1b\x5c']:
osc = b'\x1b]Ignored' + end
# Includes a smiley-face
osc = b'\x1b]Ignored\xf0\x9f\x98\x80' + end
data = osc + b'Hello world'
expected = ((b'', osc), (b'Hello world', b''))

Expand Down

0 comments on commit edc22a6

Please sign in to comment.