|
|
|
@ -2739,16 +2739,15 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
|
|
|
|
|
if capture {
|
|
|
|
|
out, _ := cmd.StdoutPipe()
|
|
|
|
|
reader := bufio.NewReader(out)
|
|
|
|
|
if err := cmd.Start(); err != nil {
|
|
|
|
|
if firstLineOnly {
|
|
|
|
|
line, _ = reader.ReadString('\n')
|
|
|
|
|
line = strings.TrimRight(line, "\r\n")
|
|
|
|
|
} else {
|
|
|
|
|
bytes, _ := io.ReadAll(reader)
|
|
|
|
|
line = string(bytes)
|
|
|
|
|
}
|
|
|
|
|
cmd.Wait()
|
|
|
|
|
cmd.Start()
|
|
|
|
|
if firstLineOnly {
|
|
|
|
|
line, _ = reader.ReadString('\n')
|
|
|
|
|
line = strings.TrimRight(line, "\r\n")
|
|
|
|
|
} else {
|
|
|
|
|
bytes, _ := io.ReadAll(reader)
|
|
|
|
|
line = string(bytes)
|
|
|
|
|
}
|
|
|
|
|
cmd.Wait()
|
|
|
|
|
} else {
|
|
|
|
|
cmd.Run()
|
|
|
|
|
}
|
|
|
|
|