parent
c8f60623f3
commit
4601e74d66
5
doc.go
5
doc.go
@ -144,6 +144,7 @@ The following environment variables are exported for shell commands:
|
||||
fx
|
||||
id
|
||||
PWD
|
||||
OLDPWD
|
||||
LF_LEVEL
|
||||
OPENER
|
||||
EDITOR
|
||||
@ -716,6 +717,10 @@ Id of the running client.
|
||||
|
||||
Present working directory.
|
||||
|
||||
OLDPWD
|
||||
|
||||
Initial working directory.
|
||||
|
||||
LF_LEVEL
|
||||
|
||||
The value of this variable is set to the current nesting level when you run lf from a shell spawned inside lf.
|
||||
|
@ -148,6 +148,7 @@ The following environment variables are exported for shell commands:
|
||||
fx
|
||||
id
|
||||
PWD
|
||||
OLDPWD
|
||||
LF_LEVEL
|
||||
OPENER
|
||||
EDITOR
|
||||
@ -768,6 +769,10 @@ Id of the running client.
|
||||
|
||||
Present working directory.
|
||||
|
||||
OLDPWD
|
||||
|
||||
Initial working directory.
|
||||
|
||||
LF_LEVEL
|
||||
|
||||
The value of this variable is set to the current nesting level when you run
|
||||
|
7
lf.1
7
lf.1
@ -164,6 +164,7 @@ The following environment variables are exported for shell commands:
|
||||
fx
|
||||
id
|
||||
PWD
|
||||
OLDPWD
|
||||
LF_LEVEL
|
||||
OPENER
|
||||
EDITOR
|
||||
@ -868,6 +869,12 @@ Id of the running client.
|
||||
.PP
|
||||
Present working directory.
|
||||
.PP
|
||||
.EX
|
||||
OLDPWD
|
||||
.EE
|
||||
.PP
|
||||
Initial working directory.
|
||||
.PP
|
||||
.EX
|
||||
LF_LEVEL
|
||||
.EE
|
||||
|
6
main.go
6
main.go
@ -65,6 +65,12 @@ func exportEnvVars() {
|
||||
os.Setenv("PAGER", envPager)
|
||||
os.Setenv("SHELL", envShell)
|
||||
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
||||
}
|
||||
os.Setenv("OLDPWD", dir)
|
||||
|
||||
level, err := strconv.Atoi(envLevel)
|
||||
if err != nil {
|
||||
log.Printf("reading lf level: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user