fix: dont prompt for continued input on incomplete input when not interactive (closes #137)

ctrl-delete
TorchedSammy 2022-04-12 19:42:57 -04:00
parent 2814f44163
commit f002eca258
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,9 @@ func handleSh(cmdString string) (uint8, error) {
if err != nil { if err != nil {
// If input is incomplete, start multiline prompting // If input is incomplete, start multiline prompting
if syntax.IsIncomplete(err) { if syntax.IsIncomplete(err) {
if !interactive {
return 126, err
}
for { for {
cmdString, err = continuePrompt(strings.TrimSuffix(cmdString, "\\")) cmdString, err = continuePrompt(strings.TrimSuffix(cmdString, "\\"))
if err != nil { if err != nil {