From 93a5107e792d413f3d0a8cc5a4ec4e1afb5bfeb4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 21 Apr 2023 21:35:59 +0530 Subject: [PATCH] Fix #6202 --- kittens/ssh/config_test.go | 3 +++ kittens/ssh/main.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kittens/ssh/config_test.go b/kittens/ssh/config_test.go index ef2dd16da..6d1e53514 100644 --- a/kittens/ssh/config_test.go +++ b/kittens/ssh/config_test.go @@ -78,6 +78,9 @@ func TestSSHConfigParsing(t *testing.T) { rt(`unset ["a"]`) conf = "env LOCAL_ENV=_kitty_copy_env_var_" rt(`export ["LOCAL_ENV","LOCAL_VAL",false]`) + conf = "env a=b\nhostname 2\ncolor_scheme xyz" + hostname = "2" + rt() ci, err := ParseCopyInstruction("--exclude moose --dest=target " + cf) if err != nil { diff --git a/kittens/ssh/main.py b/kittens/ssh/main.py index 7290b2e71..70b101a48 100644 --- a/kittens/ssh/main.py +++ b/kittens/ssh/main.py @@ -77,7 +77,11 @@ by spaces. The hostname can include an optional username in the form first hostname specification is found. Note that matching of hostname is done against the name you specify on the command line to connect to the remote host. If you wish to include the same basic configuration for many different hosts, -you can do so with the :ref:`include ` directive. +you can do so with the :ref:`include ` directive. In version 0.28.0 +the behavior of this option was changed slightly, now, when a hostname is encountered +all its config values are set to defaults instead of being inherited from a previous +matching hostname block. In particular it means hostnames dont inherit configurations, +thereby avoiding hard to understand action-at-a-distance. ''') opt('interpreter', 'sh', long_text='''