ssh kitten: Add an option to change the cwd at login

This commit is contained in:
Kovid Goyal
2022-03-07 12:24:37 +05:30
parent b0ea960159
commit c9071a66ca
7 changed files with 29 additions and 5 deletions

View File

@@ -142,9 +142,10 @@ copy --exclude */w.* d1
tset = '$A-$(echo no)-`echo no2` "something"'
for sh in self.all_possible_sh:
with self.subTest(sh=sh), tempfile.TemporaryDirectory() as tdir:
os.mkdir(os.path.join(tdir, 'cwd'))
pty = self.check_bootstrap(
sh, tdir, test_script='env; exit 0', SHELL_INTEGRATION_VALUE='',
ssh_opts={'env': {
sh, tdir, test_script='env; pwd; exit 0', SHELL_INTEGRATION_VALUE='',
ssh_opts={'cwd': '$HOME/cwd', 'env': {
'A': 'AAA',
'TSET': tset,
'COLORTERM': DELETE_ENV_VAR,
@@ -152,6 +153,7 @@ copy --exclude */w.* d1
)
pty.wait_till(lambda: 'TSET={}'.format(tset.replace('$A', 'AAA')) in pty.screen_contents())
self.assertNotIn('COLORTERM', pty.screen_contents())
pty.wait_till(lambda: '/cwd' in pty.screen_contents())
def test_ssh_leading_data(self):
script = 'echo "ld:$leading_data"; exit 0'