mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
ssh kitten: Allow configuring the ssh kitten to skip some hosts via a new `delegate` config directive
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"kitty/tools/tui/loop"
|
||||
"kitty/tools/utils"
|
||||
"kitty/tools/utils/secrets"
|
||||
"kitty/tools/utils/shlex"
|
||||
"kitty/tools/utils/shm"
|
||||
|
||||
"golang.org/x/exp/maps"
|
||||
@@ -613,6 +614,13 @@ func run_ssh(ssh_args, server_args, found_extra_args []string) (rc int, err erro
|
||||
fmt.Fprintf(os.Stderr, "Ignoring bad config line: %s:%d with error: %s", filepath.Base(x.Src_file), x.Line_number, x.Err)
|
||||
}
|
||||
}
|
||||
if host_opts.Delegate != "" {
|
||||
delegate_cmd, err := shlex.Split(host_opts.Delegate)
|
||||
if err != nil {
|
||||
return 1, fmt.Errorf("Could not parse delegate command: %#v with error: %w", host_opts.Delegate, err)
|
||||
}
|
||||
return 1, unix.Exec(utils.FindExe(delegate_cmd[0]), utils.Concat(delegate_cmd, ssh_args, server_args), os.Environ())
|
||||
}
|
||||
if host_opts.Share_connections {
|
||||
kpid, err := strconv.Atoi(os.Getenv("KITTY_PID"))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user