export 'LF_LEVEL' variable for nested instances

Related #107
This commit is contained in:
Gokcehan committed 2018-07-28 16:52:54 +03:00
1 parent 9234bcd5b8
commit e82cbb820f
2 files changed
+14

No files matched your search

+9
View File
@@ -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 {
+5
View File
@@ -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() {