ssh kitten: Fix KITTY_PUBLIC_KEY not being encoded properly when transmitting

Fixes #5496
This commit is contained in:
Kovid Goyal 2022-09-10 07:09:58 +05:30
parent dd4a65e0c9
commit 89570d3b52
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,8 @@ Detailed list of changes
- Allow passing null bytes through the system clipboard (:iss:`5483`) - Allow passing null bytes through the system clipboard (:iss:`5483`)
- ssh kitten: Fix :envvar:`KITTY_PUBLIC_KEY` not being encoded properly when transmitting (:iss:`5496`)
0.26.2 [2022-09-05] 0.26.2 [2022-09-05]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -172,7 +172,8 @@ def make_tarfile(ssh_opts: SSHOptions, base_env: Dict[str, str], compression: st
if ssh_opts.remote_kitty != 'no': if ssh_opts.remote_kitty != 'no':
env['KITTY_REMOTE'] = ssh_opts.remote_kitty env['KITTY_REMOTE'] = ssh_opts.remote_kitty
if os.environ.get('KITTY_PUBLIC_KEY'): if os.environ.get('KITTY_PUBLIC_KEY'):
env['KITTY_PUBLIC_KEY'] = os.environ['KITTY_PUBLIC_KEY'] env.pop('KITTY_PUBLIC_KEY', None)
literal_env['KITTY_PUBLIC_KEY'] = os.environ['KITTY_PUBLIC_KEY']
env_script = serialize_env(literal_env, env, base_env, for_python=compression != 'gz') env_script = serialize_env(literal_env, env, base_env, for_python=compression != 'gz')
buf = io.BytesIO() buf = io.BytesIO()
with tarfile.open(mode=f'w:{compression}', fileobj=buf, encoding='utf-8') as tf: with tarfile.open(mode=f'w:{compression}', fileobj=buf, encoding='utf-8') as tf: