Sanitize notifications ids as they are retransmitted over the TTY

This commit is contained in:
Kovid Goyal
2022-09-05 10:41:19 +05:30
parent c455fea729
commit f05783e64d
4 changed files with 19 additions and 3 deletions

View File

@@ -555,3 +555,7 @@ class TestDataTypes(BaseTest):
self.assertEqual(hash(SingleKey(key=1)), hash(SingleKey(key=1)))
self.assertNotEqual(hash(SingleKey(key=1, mods=2)), hash(SingleKey(key=1)))
self.assertNotEqual(SingleKey(key=1, mods=2), SingleKey(key=1))
def test_notify_identifier_sanitization(self):
from kitty.notify import sanitize_identifier_pat
self.ae(sanitize_identifier_pat().sub('', '\x1b\nabc\n[*'), 'abc')