Files
dial/internal/connect/connect_windows.go
T
bsncubed 8af44dfcd2 Initial commit: dial — interactive SSH host picker
A fast, read-only ~/.ssh/config picker that exec's the system ssh client.
Includes: static high-contrast picker with recency/frequency/name sort and
tag grouping, `dial keygen` (native ed25519/RSA + optional config entry), and
an optional offline YubiKey launch gate with one-time recovery codes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 23:18:23 +10:00

34 lines
767 B
Go

//go:build windows
package connect
import (
"errors"
"os"
"os/exec"
)
// execCommand runs the target as a child with inherited stdio because Windows
// has no execve-style process replacement. dial waits and then exits with the
// child's status, so from the user's perspective control still passes cleanly
// to ssh.exe (found on PATH; typically %WINDIR%\System32\OpenSSH).
func execCommand(c Command) error {
path, err := exec.LookPath(c.Bin)
if err != nil {
return err
}
cmd := exec.Command(path, c.Args...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
var ee *exec.ExitError
if errors.As(err, &ee) {
os.Exit(ee.ExitCode())
}
return err
}
os.Exit(0)
return nil // unreachable
}