diff --git a/main.go b/main.go index 9df40496..98cb39d4 100644 --- a/main.go +++ b/main.go @@ -90,6 +90,12 @@ func rescue() { // TODO(xiaq): Currently only the editor deals with signals. func interact() { ev, st := newEvalerAndStore() + + sigch := make(chan os.Signal, sigchSize) + signal.Notify(sigch) + + ed := edit.NewEditor(os.Stdin, sigch, ev, st) + datadir, err := store.EnsureDataDir() printError(err) if err == nil { @@ -113,11 +119,6 @@ func interact() { } rpromptStr := username + "@" + hostname - sigch := make(chan os.Signal, sigchSize) - signal.Notify(sigch) - - ed := edit.NewEditor(os.Stdin, sigch, ev, st) - for { cmdNum++ // name := fmt.Sprintf("", cmdNum)