Pre-calculate spawned shell level

This commit is contained in:
Arun Prakash Jana 2017-06-28 09:59:43 +05:30
parent ae9ee35e0c
commit f9a249c4a4
No known key found for this signature in database
GPG key ID: A75979F35C080412

2
nnn.c
View file

@ -411,7 +411,7 @@ spawn(char *file, char *arg1, char *arg2, char *dir, uchar flag)
/* Show a marker (to indicate nnn spawned shell) */
if (flag & SP_MARKER) {
printf("\n +-++-++-+\n | n n n |\n +-++-++-+\n\n");
printf("Shell Level %s\n", getenv("SHLVL"));
printf("Spawned shell level: %d\n", atoi(getenv("SHLVL")) + 1);
}
/* Suppress stdout and stderr */