src/nnn.c | 16 +++++++++------- diff --git a/src/nnn.c b/src/nnn.c index 80bcf0eefd8d2151a82c71d9d750688df81dcc7d..06eef652b47450a82e8e37a41dab726e82be1390 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4291,14 +4291,16 @@ if (!outdir || !*outdir) { /* Cancelled */ printwait(messages[MSG_CANCEL], NULL); return FALSE; } - - if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) { - printwarn(NULL); - return FALSE; + /* Do not create smart context for current dir */ + if (!(*outdir == '.' && outdir[1] == '\0')) { + if (!xmktree(outdir, TRUE) || (chdir(outdir) == -1)) { + printwarn(NULL); + return FALSE; + } + /* Copy the new dir path to open it in smart context */ + outdir = realpath(".", NULL); + x_to = TRUE; } - /* Copy the new dir path to open it in smart context */ - outdir = realpath(".", NULL); - x_to = TRUE; } if (getutil(utils[UTIL_ATOOL])) {