Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ishell.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (s *Shell) readMultiLinesFunc(f func(string) bool) (string, error) {
var line string
line, err = s.readLine()
fmt.Fprint(&lines, line)
if !f(line) || err != nil {
if (!f(line) || err != nil) && isQuoteClosed(lines.String()) {
break
}
fmt.Fprintln(&lines)
Expand Down Expand Up @@ -718,3 +718,11 @@ func getPosition() (int, int, error) {

return col, row, nil
}

func isQuoteClosed(lines string) bool {
_, err := shlex.Split(lines)
if err != nil && err.Error() == "EOF found when expecting closing quote." {
return false
}
return true
}