diff --git a/app.go b/app.go index 62e3cd51..cb2d834a 100644 --- a/app.go +++ b/app.go @@ -242,6 +242,15 @@ func (app *app) exportVars() { os.Setenv("EDITOR", envEditor) os.Setenv("PAGER", envPager) os.Setenv("SHELL", envShell) + + level, err := strconv.Atoi(envLevel) + if err != nil { + log.Printf("reading lf level: %s", err) + } + + level++ + + os.Setenv("LF_LEVEL", strconv.Itoa(level)) } func waitKey() error { diff --git a/main.go b/main.go index b0bad5f2..0f1fff01 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ import ( var ( envPath = os.Getenv("PATH") + envLevel = os.Getenv("LF_LEVEL") ) var ( @@ -34,6 +35,10 @@ func init() { log.Printf("hostname: %s", err) } gHostname = h + + if envLevel == "" { + envLevel = "0" + } } func startServer() {