From 97ac88dec2fe4cd2bde49d50817e359531c7280c Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Tue, 10 Aug 2021 22:34:18 +0530 Subject: [PATCH] Try to get current dir from PWD first --- src/nnn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nnn.c b/src/nnn.c index 8b64f78b..e4f9c703 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -8306,7 +8306,8 @@ int main(int argc, char *argv[]) session = NULL; } else if (argc == optind) { /* Start in the current directory */ - initpath = getcwd(NULL, 0); + initpath = getenv("PWD"); + initpath = initpath ? xstrdup(initpath) : getcwd(NULL, 0); if (!initpath) initpath = "/"; } else {