mirror of
https://github.com/zyedidia/micro
synced 2024-09-29 20:54:50 +00:00
Return error with start in RunInteractiveShell
Print and return error with process start in RunInteractiveShell if process was not able to be started. Wait until enter is pressed even if `wait` is false. Co-authored-by: Dmitry Maluka <dmitrymaluka@gmail.com>
This commit is contained in:
parent
f05d3582b3
commit
a84aa225ab
|
@ -101,16 +101,19 @@ func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error
|
|||
c := make(chan os.Signal, 1)
|
||||
signal.Reset(os.Interrupt)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
cmd.Start()
|
||||
err = cmd.Wait()
|
||||
err = cmd.Start()
|
||||
if err == nil {
|
||||
err = cmd.Wait()
|
||||
if wait {
|
||||
// This is just so we don't return right away and let the user press enter to return
|
||||
screen.TermMessage("")
|
||||
}
|
||||
} else {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
output := outputBytes.String()
|
||||
|
||||
if wait {
|
||||
// This is just so we don't return right away and let the user press enter to return
|
||||
screen.TermMessage("")
|
||||
}
|
||||
|
||||
// Start the screen back up
|
||||
screen.TempStart(screenb)
|
||||
|
||||
|
|
Loading…
Reference in a new issue