mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
Cleanup kitty dcs parsing
This commit is contained in:
@@ -83,6 +83,7 @@ class Callbacks:
|
||||
self.wtcbuf = b''
|
||||
self.iconbuf = self.colorbuf = self.ctbuf = ''
|
||||
self.titlebuf = []
|
||||
self.printbuf = []
|
||||
self.notifications = []
|
||||
self.open_urls = []
|
||||
self.cc_buf = []
|
||||
@@ -110,7 +111,10 @@ class Callbacks:
|
||||
|
||||
def handle_remote_print(self, msg):
|
||||
text = process_remote_print(msg)
|
||||
print(text, file=sys.__stdout__, end='', flush=True)
|
||||
self.printbuf.append(text)
|
||||
|
||||
def handle_remote_cmd(self, msg):
|
||||
pass
|
||||
|
||||
def handle_remote_clone(self, msg):
|
||||
msg = str(msg, 'utf-8')
|
||||
|
||||
@@ -423,6 +423,10 @@ class TestParser(BaseTest):
|
||||
c.clear()
|
||||
pb('\033P$qr\033\\', ('screen_request_capabilities', ord('$'), 'r'))
|
||||
self.ae(c.wtcbuf, f'\033P1$r{s.margin_top + 1};{s.margin_bottom + 1}r\033\\'.encode('ascii'))
|
||||
pb('\033P@kitty-cmd{abc\033\\', ('handle_remote_cmd', '{abc'))
|
||||
p = base64_encode('abcd').decode()
|
||||
pb(f'\033P@kitty-print|{p}\033\\', ('handle_remote_print', p))
|
||||
self.ae(['abcd'], s.callbacks.printbuf)
|
||||
|
||||
def test_pending(self):
|
||||
s = self.create_screen()
|
||||
|
||||
Reference in New Issue
Block a user