Allow configuring the interpreter to use on the remote host

This commit is contained in:
Kovid Goyal
2022-03-04 12:18:27 +05:30
parent 95efeee7de
commit fe27ee2d79
4 changed files with 18 additions and 6 deletions

View File

@@ -70,6 +70,14 @@ are processed alphabetically. The special value :code:`_kitty_copy_env_var_`
will cause the value of the variable to be copied from the local machine.
''')
opt('interpreter', 'sh', long_text='''
The interpreter to use on the remote host. Must be either a POSIX complaint shell
or a python executable. If the default sh is not available for broken, using
an alternate interpreter can be useful. Note that as the interpreter is used for
bootstrapping, hostname specific values are matched again the hostname from the
command line args rather than the actual remote hostname.
''')
opt('remote_dir', '.local/share/kitty-ssh-kitten', option_type='relative_dir', long_text='''
The location on the remote computer where the files needed for this kitten
are installed. The location is relative to the HOME directory. Absolute paths or paths

View File

@@ -18,6 +18,9 @@ class Parser:
def hostname(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
hostname(val, ans)
def interpreter(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['interpreter'] = str(val)
def remote_dir(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
ans['remote_dir'] = relative_dir(val)

View File

@@ -5,11 +5,12 @@ import kittens.ssh.copy
option_names = ( # {{{
'copy', 'env', 'hostname', 'remote_dir', 'shell_integration') # }}}
'copy', 'env', 'hostname', 'interpreter', 'remote_dir', 'shell_integration') # }}}
class Options:
hostname: str = '*'
interpreter: str = 'sh'
remote_dir: str = '.local/share/kitty-ssh-kitten'
shell_integration: str = 'inherit'
copy: typing.Dict[str, kittens.ssh.copy.CopyInstruction] = {}