From 6e2e4edd032e9ea5da362711421ad720e926b52d Mon Sep 17 00:00:00 2001 From: WO Date: Thu, 23 Dec 2021 19:47:11 +0100 Subject: [PATCH] don't init screen before it's necessary --- cmd/mop/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/mop/main.go b/cmd/mop/main.go index 7c64b77..b36cdd6 100644 --- a/cmd/mop/main.go +++ b/cmd/mop/main.go @@ -130,9 +130,6 @@ loop: //----------------------------------------------------------------------------- func main() { - screen := mop.NewScreen() - defer screen.Close() - usr, err := user.Current() if err != nil { panic(err) @@ -141,6 +138,9 @@ func main() { profileName := flag.String("profile", path.Join(usr.HomeDir, defaultProfile), "path to profile") flag.Parse() + screen := mop.NewScreen() + defer screen.Close() + profile := mop.NewProfile(*profileName) mainLoop(screen, profile) profile.Save()