MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / execInteractiveShell

Function execInteractiveShell

internal/cli/cli_helpers.go:509–525  ·  view source on GitHub ↗

execInteractiveShell runs the ssh binary interactively with the given argument list, inheriting stdin/stdout/stderr. Unlike the TUI's ssh helpers it does not display a "Press Enter to return to TUI" prompt on exit.

(sshArgs []string, keyfile string)

Source from the content-addressed store, hash-verified

507// argument list, inheriting stdin/stdout/stderr. Unlike the TUI's ssh helpers
508// it does not display a "Press Enter to return to TUI" prompt on exit.
509func execInteractiveShell(sshArgs []string, keyfile string) error {
510 args := make([]string, 0, len(sshArgs)+2)
511 if keyfile != "" {
512 args = append(args, "-i", keyfile)
513 }
514
515 args = append(args, sshArgs...)
516
517 // #nosec G204 -- args are built from vetted internal call sites.
518 cmd := exec.Command("ssh", args...)
519 cmd.Stdin = os.Stdin
520 cmd.Stdout = os.Stdout
521 cmd.Stderr = os.Stderr
522 cmd.Env = append(os.Environ(), "TERM=xterm-256color")
523
524 return cmd.Run()
525}
526
527// completeNodeNames is a Cobra ValidArgsFunction that returns node names for
528// tab completion. It requires no positional args already provided.

Callers 3

runNodesShellFunction · 0.85
runLXCShellFunction · 0.85
runQEMUShellFunction · 0.85

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected