Add support for RemoteCommand option in kitten ssh

This commit is contained in:
zhaolei 2026-04-14 11:11:51 +08:00
parent c60ed85cdd
commit 9b02a59c4e
4 changed files with 73 additions and 4 deletions

View file

@ -321,6 +321,11 @@ def main():
os.environ.pop('KITTY_SHELL_INTEGRATION', None)
cmd = base64.standard_b64decode(exec_cmd).decode('utf-8')
exec_with_better_error(login_shell, os.path.basename(login_shell), '-c', cmd)
remote_cmd = b'REMOTE_CMD'
if remote_cmd:
os.environ.pop('KITTY_SHELL_INTEGRATION', None)
cmd = base64.standard_b64decode(remote_cmd).decode('utf-8')
exec_with_better_error(login_shell, os.path.basename(login_shell), '-c', cmd)
TEST_SCRIPT # noqa
if ksi and 'no-rc' not in ksi:
exec_with_shell_integration()