mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04: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,15 +101,18 @@ func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error
|
|||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Reset(os.Interrupt)
|
signal.Reset(os.Interrupt)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, os.Interrupt)
|
||||||
cmd.Start()
|
err = cmd.Start()
|
||||||
|
if err == nil {
|
||||||
err = cmd.Wait()
|
err = cmd.Wait()
|
||||||
|
|
||||||
output := outputBytes.String()
|
|
||||||
|
|
||||||
if wait {
|
if wait {
|
||||||
// This is just so we don't return right away and let the user press enter to return
|
// This is just so we don't return right away and let the user press enter to return
|
||||||
screen.TermMessage("")
|
screen.TermMessage("")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
screen.TermMessage(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
output := outputBytes.String()
|
||||||
|
|
||||||
// Start the screen back up
|
// Start the screen back up
|
||||||
screen.TempStart(screenb)
|
screen.TempStart(screenb)
|
||||||
|
Loading…
Reference in New Issue
Block a user