diff options
author | Paul <paul.elder@amanokami.net> | 2017-09-19 02:30:54 -0400 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-09-19 12:00:54 +0530 |
commit | df4b557ca15cacc190f1265efe0db7d1cffae085 (patch) | |
tree | e55e7c0cfc6cd920a82efd50201bc096318ca73d /nnn.c | |
parent | 968beb434af29417a8490ce66435d157cf869495 (diff) | |
download | nnn-df4b557ca15cacc190f1265efe0db7d1cffae085.tar.gz |
Prevent nnn from waiting on open file process (#40)
* Prevent nnn from waiting on open file process
* Add env var flag to not wait for child process when opening file
* Set nowait flag once to skip bit-or every time we open a file
* Add documentation for NNN_NOWAIT
Diffstat (limited to 'nnn.c')
-rw-r--r-- | nnn.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -222,6 +222,7 @@ static char *player; static char *copier; static char *editor; static char *desktop_manager; +static char nowait; static blkcnt_t ent_blocks; static blkcnt_t dir_blocks; static ulong num_files; @@ -2211,7 +2212,7 @@ nochange: } /* Invoke desktop opener as last resort */ - spawn(utils[2], newpath, NULL, NULL, F_NOTRACE); + spawn(utils[2], newpath, NULL, NULL, nowait); continue; } default: @@ -2863,6 +2864,9 @@ main(int argc, char *argv[]) /* Get the default copier, if set */ copier = getenv("NNN_COPIER"); + /* Get nowait flag */ + nowait = F_NOTRACE | (getenv("NNN_NOWAIT") ? F_NOWAIT : 0); + signal(SIGINT, SIG_IGN); /* Test initial path */ |