diff --git a/kittens/ssh/config.py b/kittens/ssh/config.py index 0fefa83e6..ffbf9e758 100644 --- a/kittens/ssh/config.py +++ b/kittens/ssh/config.py @@ -19,9 +19,10 @@ defconf = os.path.join(config_dir, 'ssh.conf') def options_for_host(hostname: str, per_host_opts: Dict[str, SSHOptions]) -> SSHOptions: import fnmatch matches = [] - for pat, opts in per_host_opts.items(): - if fnmatch.fnmatchcase(hostname, pat): - matches.append(opts) + for spat, opts in per_host_opts.items(): + for pat in spat.split(): + if fnmatch.fnmatchcase(hostname, pat): + matches.append(opts) if not matches: return SSHOptions({}) base = matches[0] diff --git a/kittens/ssh/options/definition.py b/kittens/ssh/options/definition.py index 3f3a31303..7ed5b1165 100644 --- a/kittens/ssh/options/definition.py +++ b/kittens/ssh/options/definition.py @@ -26,12 +26,12 @@ agr('host', 'Host environment') # {{{ opt('hostname', '*', option_type='hostname', long_text=''' The hostname the following options apply to. A glob pattern to match multiple -hosts can be used. When not specified options apply to all hosts, until the +hosts can be used. Multiple hostnames can also be specified separated by spaces. +When not specified options apply to all hosts, until the first hostname specification is found. Note that the hostname this matches against is the hostname used by the remote computer, not the name you pass -to SSH to connect to it. If you wish to include the same configuration for many -different hosts, you can do so with the :code:`include` directive (see :doc:`conf`), -so that you need only two lines per host. +to SSH to connect to it. If you wish to include the same basic configuration for many +different hosts, you can do so with the :code:`include` directive (see :doc:`conf`). ''') opt('+copy', '', option_type='copy', add_to_default=False, long_text=f'''