Start work on kitty launcher for remote servers

This will automatically download kitty and run it. The ssh kitten
can add it to PATH thereby making kitty available on the remote machine
at low cost.
This commit is contained in:
Kovid Goyal
2022-04-03 15:10:20 +05:30
parent efe6ff6188
commit bae9b095b4
3 changed files with 98 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ from typing import (
from kitty.constants import (
cache_dir, runtime_dir, shell_integration_dir, ssh_control_master_template,
terminfo_dir
str_version, terminfo_dir
)
from kitty.options.types import Options
from kitty.shm import SharedMemory
@@ -171,6 +171,9 @@ def make_tarfile(ssh_opts: SSHOptions, base_env: Dict[str, str], compression: st
f'{arcname}/ssh/*', # bootstrap files are sent as command line args
f'{arcname}/zsh/kitty.zsh', # present for legacy compat not needed by ssh kitten
))
arcname = 'home/' + rd + '/kitty'
add_data_as_file(tf, arcname + '/version', str_version.encode('ascii'))
tf.add(shell_integration_dir + '/ssh/kitty', arcname=arcname + '/bin/kitty', filter=normalize_tarinfo)
tf.add(f'{terminfo_dir}/kitty.terminfo', arcname='home/.terminfo/kitty.terminfo', filter=normalize_tarinfo)
tf.add(glob.glob(f'{terminfo_dir}/*/xterm-kitty')[0], arcname='home/.terminfo/x/xterm-kitty', filter=normalize_tarinfo)
return buf.getvalue()