diff options
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/js.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/geth/js.go b/cmd/geth/js.go index 1ca59e2f4..04b44d6a9 100644 --- a/cmd/geth/js.go +++ b/cmd/geth/js.go @@ -383,6 +383,11 @@ func (self *jsre) interactive() { for { line, err := self.Prompt(<-prompt) if err != nil { + if err == liner.ErrPromptAborted { // ctrl-C + self.resetPrompt() + inputln <- "" + continue + } return } inputln <- line @@ -467,6 +472,12 @@ func (self *jsre) parseInput(code string) { var indentCount = 0 var str = "" +func (self *jsre) resetPrompt() { + indentCount = 0 + str = "" + self.ps1 = "> " +} + func (self *jsre) setIndent() { open := strings.Count(str, "{") open += strings.Count(str, "(") |