From f002eca25847a346ae2b6a6e45487e1a14efef33 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Tue, 12 Apr 2022 19:42:57 -0400 Subject: [PATCH] fix: dont prompt for continued input on incomplete input when not interactive (closes #137) --- exec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exec.go b/exec.go index 2b974b8..d2ff6cd 100644 --- a/exec.go +++ b/exec.go @@ -125,6 +125,9 @@ func handleSh(cmdString string) (uint8, error) { if err != nil { // If input is incomplete, start multiline prompting if syntax.IsIncomplete(err) { + if !interactive { + return 126, err + } for { cmdString, err = continuePrompt(strings.TrimSuffix(cmdString, "\\")) if err != nil {