diff --git a/app.go b/app.go index 97f5f23e..7bcef27d 100644 --- a/app.go +++ b/app.go @@ -371,7 +371,7 @@ func (app *app) exportFiles() { currSelections := app.nav.currSelections() - exportFiles(currFile, currSelections) + exportFiles(currFile, currSelections, app.nav.currDir().path) } // This function is used to run a shell command. Modes are as follows: diff --git a/os.go b/os.go index d6a77797..e51c85d6 100644 --- a/os.go +++ b/os.go @@ -177,12 +177,13 @@ func errCrossDevice(err error) bool { return err.(*os.LinkError).Err.(syscall.Errno) == syscall.EXDEV } -func exportFiles(f string, fs []string) { +func exportFiles(f string, fs []string, pwd string) { envFile := f envFiles := strings.Join(fs, gOpts.filesep) os.Setenv("f", envFile) os.Setenv("fs", envFiles) + os.Setenv("PWD", pwd) if len(fs) == 0 { os.Setenv("fx", envFile)