diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-06 19:18:44 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-06 20:08:11 +0800 |
commit | de86403f330e68df8fc4aee00df98374b7842d0d (patch) | |
tree | a4e5c54734e671d9f0701641d68348d2c17748e5 /cmd/ethereum/main.go | |
parent | 2393de5d6b535a850e8b5d510aa2ae4f940f3d23 (diff) | |
download | go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar.gz go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar.bz2 go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar.lz go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar.xz go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.tar.zst go-tangerine-de86403f330e68df8fc4aee00df98374b7842d0d.zip |
cmd/ethereum: fix JS REPL exit and add support for dumb terminals
It is now possible to exit the REPL using Ctrl-C, Ctrl-D or by typing "exit".
Diffstat (limited to 'cmd/ethereum/main.go')
-rw-r--r-- | cmd/ethereum/main.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index c85caf229..1133bd6f7 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -125,7 +125,6 @@ runtime will execute the file and exit. func main() { runtime.GOMAXPROCS(runtime.NumCPU()) defer logger.Flush() - utils.HandleInterrupt() if err := app.Run(os.Args); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) @@ -134,6 +133,7 @@ func main() { func run(ctx *cli.Context) { fmt.Printf("Welcome to the FRONTIER\n") + utils.HandleInterrupt() eth := utils.GetEthereum(ClientIdentifier, Version, ctx) startEth(ctx, eth) // this blocks the thread @@ -144,9 +144,8 @@ func runjs(ctx *cli.Context) { eth := utils.GetEthereum(ClientIdentifier, Version, ctx) startEth(ctx, eth) if len(ctx.Args()) == 0 { - repl := newREPL(eth) - utils.RegisterInterrupt(func(os.Signal) { repl.Stop() }) - repl.Start() + runREPL(eth) + eth.Stop() eth.WaitForShutdown() } else if len(ctx.Args()) == 1 { execJsFile(eth, ctx.Args()[0]) |