mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-02 11:43:23 +00:00
fix: dont prompt for continued input on incomplete input when not interactive (closes #137)
This commit is contained in:
parent
2814f44163
commit
f002eca258
3
exec.go
3
exec.go
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user