Skip to content

Commit

Permalink
Fix shell bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
xrlin committed Jan 15, 2019
1 parent ee6479d commit 9004c5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion env.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func uniqueSymbols(a []Symbol) (ret []Symbol) {

func exitFunc(_ ...Expression) (Expression, error) {
exit <- os.Interrupt
return NilObj, nil
return UndefObj, nil
}

func addFunc(args ...Expression) (Expression, error) {
Expand Down
2 changes: 2 additions & 0 deletions repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ func (i *Interpreter) check() {
}

func (i *Interpreter) runInInteractiveMode() {
go i.checkExit()
i.printTips()
i.prompt.Run()
}

func (i *Interpreter) exitProcess() {
close(i.exit)
fmt.Println("\nExiting...")
os.Exit(0)
}
Expand Down

0 comments on commit 9004c5e

Please sign in to comment.