Enable CWD reporting in bash integration

This commit is contained in:
Kovid Goyal
2022-03-15 15:37:17 +05:30
parent 4a1ad7755a
commit f982e754e4
2 changed files with 24 additions and 8 deletions

View File

@@ -274,8 +274,13 @@ PS1="{ps1}"
pty.send_cmd_to_child('printf "%s\x16\a%s" "a" "b"')
pty.wait_till(lambda: pty.screen_contents().count(ps1) == 2)
self.ae(pty.screen_contents(), f'{ps1}printf "%s^G%s" "a" "b"\nab{ps1}')
self.assertTrue(pty.screen.last_reported_cwd.endswith(self.home_dir))
pty.send_cmd_to_child('echo $HISTFILE')
pty.wait_till(lambda: '.bash_history' in pty.screen_contents())
q = os.path.join(self.home_dir, 'testing-cwd-notification')
os.mkdir(q)
pty.send_cmd_to_child(f'cd {q}')
pty.wait_till(lambda: pty.screen.last_reported_cwd.endswith(q))
for ps1 in ('line1\\nline\\2\\prompt> ', 'line1\nprompt> ', 'line1\\nprompt> ',):
with self.subTest(ps1=ps1), self.run_shell(