mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 14:34:52 +02:00
Use a regex for bracketed paste sanitization
This commit is contained in:
@@ -559,3 +559,10 @@ class TestDataTypes(BaseTest):
|
||||
def test_notify_identifier_sanitization(self):
|
||||
from kitty.notify import sanitize_identifier_pat
|
||||
self.ae(sanitize_identifier_pat().sub('', '\x1b\nabc\n[*'), 'abc')
|
||||
|
||||
def test_bracketed_paste_sanitizer(self):
|
||||
from kitty.utils import sanitize_for_bracketed_paste
|
||||
for x in ('\x1b[201~ab\x9b201~cd', '\x1b[201\x1b[201~~ab'):
|
||||
q = sanitize_for_bracketed_paste(x.encode('utf-8'))
|
||||
self.assertNotIn(b'\x1b[201~', q)
|
||||
self.assertNotIn('\x9b201~'.encode('utf-8'), q)
|
||||
|
||||
Reference in New Issue
Block a user