}()
}
-func RunInteractiveShell(input string, wait bool, getOutput bool) string {
+func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error) {
args, err := shellwords.Split(input)
if err != nil {
- return ""
+ return "", err
}
inputCmd := args[0]
err = cmd.Wait()
output := outputBytes.String()
- if err != nil {
- output = err.Error()
- }
if wait {
// This is just so we don't return right away and let the user press enter to return
// Start the screen back up
InitScreen()
- return output
+ return output, err
}
// HandleShellCommand runs the shell command
RunBackgroundShell(input)
return ""
} else {
- return RunInteractiveShell(input, waitToFinish, false)
+ output, _ := RunInteractiveShell(input, waitToFinish, false)
+ return output
}
}