}()
}
-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
+++ /dev/null
-// +build linux darwin dragonfly solaris openbsd netbsd freebsd
-
-package main
-
-import (
- "github.com/zyedidia/micro/cmd/micro/shellwords"
-)
-
-const TermEmuSupported = true
-
-func RunTermEmulator(input string, wait bool, getOutput bool, callback string) error {
- args, err := shellwords.Split(input)
- if err != nil {
- return err
- }
- err = CurView().StartTerminal(args, wait, getOutput, callback)
- return err
-}
--- /dev/null
+// +build linux darwin dragonfly openbsd freebsd
+
+package main
+
+import (
+ "github.com/zyedidia/micro/cmd/micro/shellwords"
+)
+
+const TermEmuSupported = true
+
+func RunTermEmulator(input string, wait bool, getOutput bool, callback string) error {
+ args, err := shellwords.Split(input)
+ if err != nil {
+ return err
+ }
+ err = CurView().StartTerminal(args, wait, getOutput, callback)
+ return err
+}
--- /dev/null
+// +build !linux,!darwin,!freebsd,!dragonfly,!openbsd
+
+package main
+
+import "errors"
+
+const TermEmuSupported = false
+
+func RunTermEmulator(input string, wait bool, getOutput bool) error {
+ return errors.New("Unsupported operating system")
+}
+++ /dev/null
-// +build plan9 nacl windows
-
-package main
-
-import "errors"
-
-const TermEmuSupported = false
-
-func RunTermEmulator(input string, wait bool, getOutput bool) error {
- return errors.New("Unsupported operating system")
-}