Skip to content

Commit

Permalink
Pre-calculate spawned shell level
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Jun 28, 2017
1 parent ae9ee35 commit f9a249c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f9a249c

Please sign in to comment.