mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 14:04:52 +02:00
Avoid one record read
This commit is contained in:
@@ -88,11 +88,12 @@ def make_tarfile(ssh_opts: SSHOptions, base_env: Dict[str, str]) -> bytes:
|
||||
env[q] = val
|
||||
env.update(ssh_opts.env)
|
||||
env['KITTY_SHELL_INTEGRATION'] = ksi or DELETE_ENV_VAR
|
||||
env['KITTY_SSH_KITTEN_DATA_DIR'] = ssh_opts.remote_dir
|
||||
env_script = serialize_env(env, base_env)
|
||||
buf = io.BytesIO()
|
||||
with tarfile.open(mode='w:bz2', fileobj=buf, encoding='utf-8') as tf:
|
||||
rd = ssh_opts.remote_dir.rstrip('/')
|
||||
add_data_as_file(tf, rd + '/settings/env-vars.sh', env_script)
|
||||
add_data_as_file(tf, 'kitty-ssh-kitten-data.sh', env_script)
|
||||
if ksi:
|
||||
tf.add(shell_integration_dir, arcname=rd + '/shell-integration', filter=filter_files)
|
||||
tf.add(terminfo_dir, arcname='.terminfo', filter=filter_files)
|
||||
@@ -145,7 +146,6 @@ def get_ssh_data(msg: str, ssh_opts: Optional[Dict[str, SSHOptions]] = None) ->
|
||||
from base64 import standard_b64encode
|
||||
encoded_data = standard_b64encode(data)
|
||||
yield fmt_prefix(len(encoded_data))
|
||||
yield fmt_prefix(resolved_ssh_opts.remote_dir)
|
||||
yield encoded_data
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user