v1
Test / test (push) Successful in 3m36s
Release / release (push) Successful in 7m31s

This commit is contained in:
Sebastian Unterschütz committed 2026-11-17 19:00:44 +01:00
commit 8d4915543e
132 files changed
+20628

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
package ssh
import (
"fmt"
"os"
"os/exec"
"syscall"
)
// Exec replaces the current process with the native ssh client via syscall.Exec.
// All existing SSH configs, keys, and agent forwarding remain intact.
func Exec(args []string) error { return SSH.Exec(args) }
// Exec replaces the current process with the client's binary.
func (c Client) Exec(args []string) error {
path, err := exec.LookPath(c.Name)
if err != nil {
return fmt.Errorf("%s not found in PATH: %w", c.Name, err)
}
argv := append([]string{c.Name}, args...)
return syscall.Exec(path, argv, os.Environ())
}