Also test changing of title when running command
This commit is contained in:
parent
261057396c
commit
da5e37620e
@ -31,7 +31,7 @@ class Callbacks:
|
||||
self.wtcbuf += data
|
||||
|
||||
def title_changed(self, data) -> None:
|
||||
self.titlebuf += data
|
||||
self.titlebuf.append(data)
|
||||
|
||||
def icon_changed(self, data) -> None:
|
||||
self.iconbuf += data
|
||||
@ -61,7 +61,8 @@ class Callbacks:
|
||||
|
||||
def clear(self) -> None:
|
||||
self.wtcbuf = b''
|
||||
self.iconbuf = self.titlebuf = self.colorbuf = self.ctbuf = ''
|
||||
self.iconbuf = self.colorbuf = self.ctbuf = ''
|
||||
self.titlebuf = []
|
||||
self.iutf8 = True
|
||||
self.notifications = []
|
||||
self.open_urls = []
|
||||
|
||||
@ -213,18 +213,18 @@ class TestParser(BaseTest):
|
||||
c = s.callbacks
|
||||
pb('a\033]2;x\\ryz\x9cbcde', 'a', ('set_title', 'x\\ryz'), 'bcde')
|
||||
self.ae(str(s.line(0)), 'abcde')
|
||||
self.ae(c.titlebuf, 'x\\ryz')
|
||||
self.ae(c.titlebuf, ['x\\ryz'])
|
||||
c.clear()
|
||||
pb('\033]\x07', ('set_title', ''), ('set_icon', ''))
|
||||
self.ae(c.titlebuf, ''), self.ae(c.iconbuf, '')
|
||||
self.ae(c.titlebuf, ['']), self.ae(c.iconbuf, '')
|
||||
pb('\033]ab\x07', ('set_title', 'ab'), ('set_icon', 'ab'))
|
||||
self.ae(c.titlebuf, 'ab'), self.ae(c.iconbuf, 'ab')
|
||||
self.ae(c.titlebuf, ['', 'ab']), self.ae(c.iconbuf, 'ab')
|
||||
c.clear()
|
||||
pb('\033]2;;;;\x07', ('set_title', ';;;'))
|
||||
self.ae(c.titlebuf, ';;;')
|
||||
self.ae(c.titlebuf, [';;;'])
|
||||
c.clear()
|
||||
pb('\033]2;\x07', ('set_title', ''))
|
||||
self.ae(c.titlebuf, '')
|
||||
self.ae(c.titlebuf, [''])
|
||||
pb('\033]110\x07', ('set_dynamic_color', 110, ''))
|
||||
self.ae(c.colorbuf, '')
|
||||
c.clear()
|
||||
|
||||
@ -67,8 +67,10 @@ RPS1="{rps1}"
|
||||
except TimeoutError:
|
||||
raise AssertionError(f'Cursor was not changed to beam. Screen contents: {repr(pty.screen_contents())}')
|
||||
self.ae(pty.screen_contents(), q)
|
||||
self.ae(pty.callbacks.titlebuf, '~')
|
||||
self.ae(pty.callbacks.titlebuf, ['~'])
|
||||
pty.callbacks.clear()
|
||||
pty.send_cmd_to_child('mkdir test && ls -a')
|
||||
pty.wait_till(lambda: pty.screen_contents().count(ps1) == 2)
|
||||
self.ae(pty.callbacks.titlebuf, ['mkdir test && ls -a', '~'])
|
||||
q = '\n'.join(str(pty.screen.line(i)) for i in range(1, pty.screen.cursor.y))
|
||||
self.ae(pty.last_cmd_output(), q)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user