Terminal end of OSC 5522 read requests

This commit is contained in:
Kovid Goyal
2022-11-29 14:55:40 +05:30
parent f0d61c2de9
commit 11724c8a5f
4 changed files with 81 additions and 7 deletions

View File

@@ -99,6 +99,10 @@ def sanitize_identifier_pat() -> 're.Pattern[str]':
return re.compile(r'[^a-zA-Z0-9-_+.]+')
def sanitize_id(v: str) -> str:
return sanitize_identifier_pat().sub('', v)
def parse_osc_99(raw: str) -> NotificationCommand:
cmd = NotificationCommand()
metadata, payload = raw.partition(';')[::2]
@@ -114,7 +118,7 @@ def parse_osc_99(raw: str) -> NotificationCommand:
if k == 'p':
payload_type = v
elif k == 'i':
cmd.identifier = sanitize_identifier_pat().sub('', v)
cmd.identifier = sanitize_id(v)
elif k == 'e':
payload_is_encoded = v == '1'
elif k == 'd':