From 0776a238c4c10a35b39160f37271bc8b5cd026b0 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 18 Jan 2024 20:20:20 +0100 Subject: split --- c_exec.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'c_exec.go') diff --git a/c_exec.go b/c_exec.go index 8b37976..da97346 100644 --- a/c_exec.go +++ b/c_exec.go @@ -135,7 +135,7 @@ func c_format_rdp(host *HostNode) []string { return cmd_fmt } -func c_format_cmd(host *HostNode) { +func c_format_cmd(host *HostNode, term string) { var cmd_fmt []string switch host.Protocol { @@ -146,12 +146,15 @@ func c_format_cmd(host *HostNode) { default: c_die("type not found", nil) } + if len(term) > 0 { + cmd_fmt = append([]string{term, "-e"}, cmd_fmt...) + } c_exec_cmd(cmd_fmt) } -func c_exec(host *HostNode) { +func c_exec(host *HostNode, term string) { if host == nil { return } - c_format_cmd(host) + c_format_cmd(host, term) } -- cgit v1.2.3